-
LeetCode—292. Nim Game
必胜策略:第一次拿 n%4个,然后不管对手拿多少个,自己拿 (n-对手拿的个数)就必赢了 //url:http…
-
LeetCode—762. Prime Number of Set Bits in Binary Representation
分两步,首先获取为1的bit位的数量,然后判断改数量是否是质数, 10^6的位数有限,可以先写出对应范围内的质…
-
LeetCode—104. Maximum Depth of Binary Tree
递归遍历即可 //url:https://leetcode.com/problems/maximum-dept…
-
LeetCode—693. Binary Number with Alternating Bits
solution 1: 低效,每次判断最后一位bit的值,然后和上一次最后一位的bit值对比 //url:ht…
-
LeetCode—637. Average of Levels in Binary Tree
solution 1: 比较低效 //url:https://leetcode.com/problems/av…
-
LeetCode—669. Trim a Binary Search Tree
solution 1: //url:https://leetcode.com/problems/trim-a-…
-
LeetCode—557. Reverse Words in a String III
//url:https://leetcode.com/problems/reverse-words-in-a-…
-
LeetCode—876. Middle of the Linked List
//url:https://leetcode.com/problems/middle-of-the-linke…
-
什么鬼~
用了多年的梯子突然用不了了,除了贸易战,疫苗和汇率,大天朝又发生了什么大事吗。。。 google上不了就算了,…
-
LeetCode—344. Reverse String
//url:https://leetcode.com/problems/reverse-string/desc…