leetcode系列题
文章平均质量分 60
leetcode系列题
Bryan要加油
这个作者很懒,什么都没留下…
展开
-
275. H-Index II[Medium](Leetcode每日一题-2021.07.12)--抄答案
ProblemGiven an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted in an ascending order, return compute the researcher’s h-index.According to the definition of h-in原创 2021-07-12 21:37:22 · 195 阅读 · 0 评论 -
1473. Paint House III(Leetcode每日一题-2021.05.04)--抄答案
ProblemThere is a row of m houses in a small city, each house must be painted with one of the n colors (labeled from 1 to n), some houses that have been painted last summer should not be painted again.A neighborhood is a maximal group of continuous house原创 2021-05-04 21:46:08 · 256 阅读 · 0 评论 -
137. Single Number II(Leetcode每日一题-2021.04.30)--抄答案
ProblemGiven an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it.Constraints:1 <= nums.length <= 3 * 10^4-2^31 <= nums[i] <= 2^31 - 1Each element原创 2021-04-30 21:43:38 · 95 阅读 · 1 评论 -
377. Combination Sum IV(Leetcode每日一题-2021.04.24)
ProblemGiven an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.The answer is guaranteed to fit in a 32-bit integer.Constraints:1 <= nums.length <= 2001 <= nums[i]原创 2021-04-24 11:13:27 · 197 阅读 · 0 评论 -
220. Contains Duplicate III(Leetcode每日一题-2021.04.17)--抄答案
ProblemGiven an integer array nums and two integers k and t, return true if there are two distinct indices i and j in the array such that abs(nums[i] - nums[j]) <= t and abs(i - j) <= k.Constraints:0 <= nums.length <= 2 * 10^4-2^31 <= n原创 2021-04-17 08:07:48 · 357 阅读 · 0 评论 -
213. House Robber II(Leetcode每日一题-2021.04.15)
ProblemYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanwhile, adjacen原创 2021-04-15 08:53:45 · 527 阅读 · 0 评论 -
198. House Robber(Leetcode每日一题-2020.05.29)
RT原创 2020-05-31 21:57:26 · 188 阅读 · 0 评论 -
337. House Robber III(Leetcode每日一题-2020.08.05)
ProblemThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that “all houses in t原创 2020-08-06 21:27:06 · 171 阅读 · 0 评论 -
264. Ugly Number II(Leetcode每日一题-2021.04.11)--抄答案
ProblemGiven an integer n, return the nth ugly number.Ugly number is a positive number whose prime factors only include 2, 3, and/or 5.Constraints:1 <= n <= 1690Example1Input: n = 10Output: 12Explanation: [1, 2, 3, 4, 5, 6, 8, 9, 10, 12] i原创 2021-04-11 21:36:45 · 392 阅读 · 0 评论 -
154. Find Minimum in Rotated Sorted Array II(Leetcode每日一题-2021.04.09)
ProblemSuppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,4,4,5,6,7] might become:[4,5,6,7,0,1,4] if it was rotated 4 times.[0,1,4,4,5,6,7] if it was rotated 7 times.Notice that原创 2021-04-09 10:38:54 · 620 阅读 · 0 评论 -
81. Search in Rotated Sorted Array II(Leetcode每日一题-2021.04.07)
ProblemThere is an integer array nums sorted in non-decreasing order (not necessarily with distinct values).Before being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [n原创 2021-04-07 16:14:08 · 661 阅读 · 0 评论 -
80. Remove Duplicates from Sorted Array II(Leetcode每日一题-2021.04.06)
ProblemGiven a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for another array; you must do this by modifying the input array in-place with O(1) extra m原创 2021-04-06 16:48:54 · 684 阅读 · 0 评论 -
92. Reverse Linked List II(Leetcode每日一题-2021.03.18)
ProblemGiven the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.Constraints:The number of nodes in the list is n.1 &原创 2021-03-18 08:52:22 · 184 阅读 · 0 评论 -
59. Spiral Matrix II(Leetcode每日一题-2021.03.16)
ProblemGiven a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.Constraints:1 <= n <= 20Example1Input: n = 3Output: [[1,2,3],[8,9,4],[7,6,5]]Example2Input: n = 1Output: [[1]]Solutionclas原创 2021-03-16 08:32:48 · 120 阅读 · 0 评论 -
706. Design HashMap(Leetcode每日一题-2021.03.14)
ProblemDesign a HashMap without using any built-in hash table libraries.Implement the MyHashMap class:MyHashMap() initializes the object with an empty map.void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already ex原创 2021-03-14 18:59:36 · 180 阅读 · 0 评论 -
227. Basic Calculator II(Leetcode每日一题-2021.03.11)
ProblemGiven a string s which represents an expression, evaluate this expression and return its value.The integer division should truncate toward zero.Constraints:1 <= s.length <= 3 * 10^5s consists of integers and operators (’+’, ‘-’, ‘*’, ‘/’原创 2021-03-11 19:23:24 · 153 阅读 · 0 评论 -
132. Palindrome Partitioning II(Leetcode每日一题-2021.03.08)
ProblemGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.Constraints:1 <= s.length <= 2000s consists of lower-case English letters only.E原创 2021-03-08 20:30:31 · 141 阅读 · 0 评论 -
503. Next Greater Element II(Leetcode每日一题-2021.03.06)
ProblemGiven a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The Next Greater Number of a number x is the first greater number to its traversing-order next in the原创 2021-03-07 09:43:30 · 114 阅读 · 0 评论 -
Leetcode 207. Course Schedule&210. Course Schedule II
207. Course ScheduleProblem原创 2020-11-22 19:58:54 · 127 阅读 · 0 评论 -
Leetcode 78. Subsets && Leetcode 90. Subsets II
78. SubsetsProblemGiven an integer array nums, return all possible subsets (the power set).The solution set must not contain duplicate subsets.Example1Input: nums = [1,2,3]Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]Example2Input: nums = [原创 2020-11-22 19:54:00 · 149 阅读 · 0 评论