Alan Zhan 部落格

Live for nothing, or die for something

白話解 Leetcode - 25 Reverse Nodes in k-Group

25. Reverse Nodes in k-Group https://leetcode.com/problems/reverse-nodes-in-k-group/ HardGiven the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is …

白話解 Leetcode - 70 Climbing Stairs

70. Climbing Stairs https://leetcode.com/problems/climbing-stairs/ EasyYou are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many …

白話解 Leetcode - 69 Sqrt(x)

69. Sqrt(x) https://leetcode.com/problems/sqrtx/ EasyGiven a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are …

白話解 Leetcode - 433 Minimum Genetic Mutation

433. Minimum Genetic Mutation https://leetcode.com/problems/minimum-genetic-mutation/ MediumA gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'. …

白話解 Leetcode - 23 Merge k Sorted Lists

23. Merge k Sorted Lists https://leetcode.com/problems/merge-k-sorted-lists/ HardYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the …

白話解 Leetcode - 200 Number of Islands

200. Number of Islands https://leetcode.com/problems/number-of-islands/ MediumGiven an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. …

白話解 Leetcode - 78 Subsets

78. Subsets https://leetcode.com/problems/subsets/ MediumGiven an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate …

白話解 Leetcode - 111 Minimum Depth of Binary Tree

111. Minimum Depth of Binary Tree https://leetcode.com/problems/minimum-depth-of-binary-tree/ EasyGiven a binary tree, find its minimum depth. The minimum depth is the number of nodes along the …

白話解 Leetcode - 104 Maximum Depth of Binary Tree

104. Maximum Depth of Binary Tree https://leetcode.com/problems/maximum-depth-of-binary-tree/ EasyGiven the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the …

白話解 Leetcode - 226 Invert Binary Tree

226. Invert Binary Tree https://leetcode.com/problems/invert-binary-tree/ EasyGiven the root of a binary tree, invert the tree, and return its root.   Example 1: Input: root = [4,2,7,1,3,6,9] …