ARTS #157 Algorithm 本周选择的算法题是:transpose-matrix。 规则 Given a 2D integer array matrix, return the transpose of matrix. The transpose of a matrix is the matrix flipped over its main diagonal, switching the m... 2022-06-046 min read
ARTS #156 Algorithm 本周选择的算法题是:Number of Steps to Reduce a Number to Zero。 规则 Given an integer num, return the number of steps to reduce it to zero. In one step, if the current number is even, you have to... 2022-05-294 min read
ARTS #155 Algorithm 本周选择的算法题是:Coin Change。 规则 You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the few... 2022-05-225 min read
ARTS #154 Algorithm 本周选择的算法题是:Permutations II。 规则 Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Example 1: Input: nums = [1,1,... 2022-05-154 min read
ARTS #153 Algorithm 本周选择的算法题是:132 Pattern。 规则 Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < nu... 2022-05-084 min read
ARTS #152 Algorithm 本周选择的算法题是:Design Underground System。 规则 An underground railway system is keeping track of customer travel times between different stations. They are using this data to calculate the av... 2022-04-3012 min read
ARTS #151 Algorithm 本周选择的算法题是:Recover Binary Search Tree。 规则 You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tr... 2022-04-243 min read
ARTS #150 Algorithm 本周选择的算法题是:Convert BST to Greater Tree。 规则 Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original ... 2022-04-166 min read
ARTS #149 Algorithm 本周选择的算法题是:Swapping Nodes in a Linked List。 规则 You are given the head of a linked list, and an integer k. Return the head of the linked list after swapping the values of the kth node f... 2022-04-104 min read
ARTS #148 Algorithm 本周选择的算法题是:Next Permutation。 规则 A permutation of an array of integers is an arrangement of its members into a sequence or linear order. For example, for arr = [1,2,3], the following... 2022-04-044 min read