logo头像

不忘初心,奋力前行!

leetcode题目解析(190702)

leetcode9: Palindrome(回文数)题目描述判断一个整数是否是回文数。 题目解析我们通过观察可以看出,回文数有以下两种类型:ABA和ABBA。所以本质上它们都还是镜像对称的,所以可以想到一个结构,就是队列。我们可以把数...

leetcode题目解析(190513)

Construct binary tree from preorder and inorder traversal题目描述Given preorder and inorder traversal of a tree, construc...

leetcode题目解析(190524)

valid sudoku题目描述Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be pa...

leetcode题目解析(190425)

Remove Duplicates from sorted Array II题目描述Follow up for “Remove Duplicates”:What if duplicates are allowed at most tw...

trapping rain water

Trapping Rain Water题目描述Given n non-negative integers representing an elevation map where the width of each bar is 1, ...