
leetcode刷题
光亮那方
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2021-05-16
第一周刷题 121. Best Time to Buy and Sell Stock 122. Best Time to Buy and Sell Stock II 123. Best Time to Buy and Sell Stock III 188. Best Time to Buy and Sell Stock IV原创 2021-05-16 22:29:45 · 116 阅读 · 0 评论 -
leetcode刷题-23.Merge K Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->...原创 2019-08-09 20:55:34 · 250 阅读 · 0 评论 -
leetcode刷题-148. Sort List
Sort a linked list in O(n log n) time using constant space complexity. Input: 4->2->1->3 Output: 1->2->3->4 Input: -1->5->3->4->0 Output: -1->0->3->4->5 这道题...原创 2019-08-10 21:02:13 · 138 阅读 · 0 评论 -
leetcode刷题-78.Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Input: nums = [1,2,3] Output: [ [3], [1], [2], [1,2,3...原创 2019-08-11 18:34:42 · 126 阅读 · 0 评论 -
leetcode刷题-136.Single Number
Given a non-empty array of integers, every element appears twice except for one. Find that single one. Example 1: Input: [2,2,1] Output: 1 Example 2: Input: [4,1,2,1,2] Output: 4 找到数组中只出现一次的数,思路...原创 2019-08-12 20:49:21 · 137 阅读 · 0 评论 -
leetcode刷题-169.Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element alwa...原创 2019-08-21 17:30:37 · 183 阅读 · 0 评论 -
leetcode刷题-231.Power of Two
Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Output: true Explanation: 24 = 16 Example 3: Input...原创 2019-08-21 18:13:49 · 203 阅读 · 0 评论 -
leetcode刷题-104.Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A leaf is a node with no children...原创 2019-08-21 18:46:50 · 142 阅读 · 0 评论