摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2019-01-11 16:49 __Meng 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a collection of distinct integers, return all possible permutations. Example: 阅读全文
posted @ 2019-01-11 16:09 __Meng 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: Input: nums = [1], k = 1 Output: [1] Example 2: Note: 阅读全文
posted @ 2019-01-11 15:30 __Meng 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iteratively 阅读全文
posted @ 2019-01-11 11:22 __Meng 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2019-01-11 10:52 __Meng 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the pers 阅读全文
posted @ 2019-01-11 10:26 __Meng 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2019-01-11 09:45 __Meng 阅读(111) 评论(0) 推荐(0) 编辑