ARTS #120 Algorithm 本周选择的算法题是:Majority Element。 规则 Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume tha...
ARTS #119 Algorithm 本周选择的算法题是:Word Break。 规则 Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. Note...
ARTS #118 Algorithm 本周选择的算法题是:Contains Duplicate。 规则 Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: ...
ARTS #117 Algorithm 本周选择的算法题是:Target Sum。 规则 You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each in...
Google 工作法 《重新定义团队》 Google 的人才密度很高,这其中很大原因要归结为对招聘环节的重视。优秀候选人在公司、行业里有不错的位置,各个行业绝大多数的顶尖人才并没有在找工作,通过一般的招聘渠道很难找到好的候选人。Google 采用了主动出击的方式,如员工内推、行业搜寻等,就算用人需求很大,在竞争激烈的市场环境下也没有为了短期利益损害长期以来坚持的价值观。 Google 需要的人有两个特点: ...
ARTS #116 Algorithm 本周选择的算法题是:Implement Trie (Prefix Tree)。 规则 A trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. The...
ARTS #115 Algorithm 本周选择的算法题是:Decode Ways。 规则 A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an ...
崩溃治理概述 崩溃治理的重要性体现在两个维度: 从拉新成本上看,一个用户的成本大概是80块,以100万用户*千分之五的崩溃率得出受影响的用户数为5000人,如果这些用户流失将直接损失40万。 从时间成本计算,稿定的模块搜索、编辑器、下单支付等链路的最短操作时间要 120s 左右,遇到崩溃后用户需要重新打开 App,假设第二次不崩溃,那么对100万用户来说,千分之五的崩溃率意味每天要浪费掉 60...
ARTS #114 Algorithm 本周选择的算法题是:Balanced Binary Tree。 规则 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which t...
Clean Code 格式 抛掉“只要代码能跑”的想法,今天编写出的代码,可能要在下个版本中修改,但代码的可读性却会对未来潜在修改行为产生深远的影响。 垂直原则 用 200 行、最长 500 行的文件组装成系统。虽然这并非不可违背的原则,但也应该乐于接受 — 通常小文件比大文件更易于理解。 向报纸学习 想象一篇写得很好的报纸文章,你是从顶部开始垂直阅读它的,标题会告诉你是关于什么的故事,并让你决定是否要进一步阅...