![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 71
Lvfucius
这个作者很懒,什么都没留下…
展开
-
342. Power of Four
Power of Four题目难度思路代码结果感想 题目 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Given num = 16, return true. Given num = 5, return false. Follow up: Coul...原创 2018-09-19 21:33:27 · 83 阅读 · 0 评论 -
406. Queue Reconstruction by Height
题目 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 person and k is the number of people in front of th...原创 2018-10-08 21:58:38 · 208 阅读 · 0 评论 -
382. Linked List Random Node
题目 Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen. Follow up: What if the linked list is extremely large and it...原创 2018-10-08 10:17:36 · 123 阅读 · 0 评论 -
41. First Missing Positive
题目 Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 Not...原创 2018-09-28 17:32:57 · 74 阅读 · 0 评论 -
783. Minimum Distance Between BST Nodes
题目 Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Example : Input: root = [4,2,6,1,3,null,null] Outp...原创 2018-09-27 18:14:37 · 132 阅读 · 0 评论 -
352. Data Stream as Disjoint Intervals
题目 Given a data stream input of non-negative integers a1, a2, …, an, …, summarize the numbers seen so far as a list of disjoint intervals. For example, suppose the integers from the data stream are 1,...原创 2018-09-27 18:07:54 · 117 阅读 · 0 评论 -
849. Maximize Distance to Closest Person
题目 In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least one person sitting. Alex wants to sit in the s...原创 2018-09-20 18:14:13 · 142 阅读 · 0 评论 -
136. Single Number
题目 Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without u...原创 2018-09-25 21:52:20 · 88 阅读 · 0 评论 -
796. Rotate String
题目 We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = ‘abcde’, then it will be ‘bcdea’ after o...原创 2018-09-19 21:49:02 · 90 阅读 · 0 评论 -
815. Bus Routes
题目 We have a list of bus routes. Each routes[i] is a bus route that the i-th bus repeats forever. For example if routes[0] = [1, 5, 7], this means that the first bus (0-th indexed) travels in the sequ...原创 2018-10-30 09:17:05 · 198 阅读 · 0 评论