ARTS #136 Algorithm 本周选择的算法题是:Concatenation of Array。 规则 Given an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <=... 2022-01-085 min read
ARTS #135 Algorithm 本周选择的算法题是:Cherry Pickup II。 规则 You are given a rows x cols matrix grid representing a field of cherries where grid[i][j] represents the number of cherries that you can collect from the... 2022-01-018 min read
ARTS #134 Algorithm 本周选择的算法题是:Simplify Path。 规则 Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified ... 2021-12-256 min read
ARTS #133 Algorithm 本周选择的算法题是:Combinations。 规则 Given two integers n and k, return all possible combinations of k numbers out of the range [1, n]. You may return the answer in any order. Example 1: Inpu... 2021-12-184 min read
ARTS #132 Algorithm 本周选择的算法题是:Minimum Number of Operations to Move All Balls to Each Box。 规则 You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empt... 2021-12-114 min read
ARTS #131 Algorithm 本周选择的算法题是:Partitioning Into Minimum Number Of Deci-Binary Numbers。 规则 A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For examp... 2021-12-042 min read
重视「重要不紧急的」事情 从时间管理角度上看,我们一般会把事情按照四象限法则分为重要紧急的、重要不紧急的、不重要紧急的、不重要不紧急的,而其中最重要的部分可能是 — 重要不紧急的。 为什么说重要不紧急的是最重要的呢?我们可以简单分析下: 重要且紧急的 — 简称救火。传统观念认为要立刻处理,这没有错,但是如果这类事件太多,一定需要思考为什么会有那么多救火的事情,多数原因是没做好规划 重要但不紧急 — 我称... 2021-12-031 min read
ARTS #130 Algorithm 本周选择的算法题是:Path Sum。 规则 Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equal... 2021-11-274 min read
ARTS #129 Algorithm 本周选择的算法题是:Recover a Tree From Preorder Traversal。 规则 We run a preorder depth-first search (DFS) on the root of a binary tree. At each node in this traversal, we output D dashes (where... 2021-11-204 min read
ARTS #128 Algorithm 本周选择的算法题是:Reducing Dishes。 规则 A chef has collected data on the satisfaction level of his n dishes. Chef can cook any dish in 1 unit of time. Like-time coefficient of a dish is defined... 2021-11-153 min read