- 博客(42)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 LeetCode 题目讲解集合
LeetCode 题目集合题号难度正文1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
2020-04-21 07:38:08
226
原创 LeetCode1466. Reorder Routes to Make All Paths Lead to the City Zero
[Med] LeetCode 1466. Reorder Routes to Make All Paths Lead to the City Zero链接: https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/题目描述:There are n cities numbered from 0 to n-1 and n-1 roads such that there is only one
2020-06-01 07:03:45
378
原创 LeetCode 72. Edit Distance
[Hard] LeetCode 72. Edit Distance链接: https://leetcode.com/problems/edit-distance/题目描述:Given two words word1 and word2, find the minimum number of operationsrequired to convert word1 to word2.You have the following 3 operations permitted on a word:I
2020-06-01 04:58:20
212
原创 LeetCode 973. K Closest Points to Origin
[Med] LeetCode 973. K Closest Points to Origin链接: https://leetcode.com/submissions/detail/206164544/题目描述:We have a list of points on the plane. Find the K closest points to the origin (0, 0).(Here, the distance between two points on a plane is the Eu
2020-06-01 00:21:24
357
原创 LeetCode 1035. Uncrossed Lines
[Med] LeetCode 1035. Uncrossed Lines链接: https://leetcode.com/problems/uncrossed-lines/题目描述:We write the integers of A and B (in the order they are given) on two separate horizontal lines.Now, we may draw connecting lines: a straight line connecting t
2020-05-26 02:48:46
316
原创 LeetCode 1426 Counting Elements
[Med] LeetCode 1426 Counting Elements链接:题目描述:Given an integer array arr, count element x such that x + 1 is also in arr.If there’re duplicates in arr, count them seperately.Example 1:Input: arr = [1,2,3]Output: 2Explanation: 1 and 2 are counted c
2020-05-25 01:54:25
306
原创 LeetCode 1427: Perform String Shifts
[Easy] LeetCode 1427: Perform String Shifts链接: https://leetcode.com/problems/perform-string-shifts/题目描述:You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]:direction can be 0 (for lef
2020-05-25 01:51:36
257
原创 LeetCode 1429. First Unique Number
[Med] LeetCode 1429. First Unique Number链接:题目描述:You have a queue of integers, you need to retrieve the first unique integer in the queue.Implement the FirstUnique class:FirstUnique(int[] nums) Initializes the object with the numbers in the queue.int
2020-05-25 01:46:43
704
原创 LeetCode 459. Repeated Substring Pattern
[Easy] LeetCode 459. Repeated Substring Pattern链接: https://leetcode.com/problems/repeated-substring-pattern/题目描述:Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together
2020-05-25 01:35:29
231
原创 LeetCode 986. Interval List Intersections
[Med] LeetCode 986. Interval List Intersections链接: https://leetcode.com/problems/interval-list-intersections/题目描述:Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order.Return the intersection of these two
2020-05-24 04:18:29
210
原创 LeetCode 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
[Med] LeetCode 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree链接: https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/题目描述:Given a binary tree where each pa
2020-05-24 02:32:00
346
原创 LeetCode 1428. Leftmost Column with at Least a One
[Med] LeetCode (未知题号) Leftmost Column with at Least a One链接:题目描述:(This problem is an interactive problem.)A binary matrix means that all elements are 0 or 1. For each individual row of the matrix...
2020-05-24 02:15:26
1162
原创 LeetCode 402. Remove K Digits
[Med] LeetCode 402. Remove K Digits链接: https://leetcode.com/problems/remove-k-digits/题目描述: Given a non-negative integer num represented as a string, remove k digitsfrom the number so that the new number is the smallest possible.Example 1:Input: num
2020-05-14 06:08:46
168
原创 LeetCode 997. Find the Town Judge
[Easy] LeetCode 997. Find the Town Judge链接: https://leetcode.com/problems/find-the-town-judge/题目描述:In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge.If the town judge exists, then
2020-05-11 01:11:12
170
原创 LeetCode 1433. Check If a String Can Break Another String
[Med] LeetCode 1433. Check If a String Can Break Another String链接:题目描述:Example 1:Input: s1 = “abc”, s2 = “xya”Output: trueExplanation: “ayx” is a permutation of s2=“xya” which can break to string “abc” which is a permutation of s1=“abc”.Example 2
2020-05-11 00:34:06
296
1
原创 LeetCode 826. Most Profit Assigning Work
[Med] LeetCode 826. Most Profit Assigning Work链接: https://leetcode.com/problems/most-profit-assigning-work/题目描述:We have jobs: difficulty[i] is the difficulty of the ith job, and profit[i] is the profit of the ith job.Now we have some workers. worker[i
2020-05-10 07:43:37
216
原创 LeetCode 367. Valid Perfect Square
[Easy] LeetCode 367. Valid Perfect Square链接: https://leetcode.com/problems/valid-perfect-square/题目描述:Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function
2020-05-10 06:57:34
150
原创 LeetCode 383. Ransom Note
[Easy] LeetCode 383. Ransom Note链接: https://leetcode.com/problems/ransom-note/题目描述:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a funct...
2020-05-04 04:10:27
118
原创 Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
[Med] LeetCode Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree链接:题目描述:Given a binary tree where each path going from the root to any leaf form a valid sequence, che...
2020-05-02 12:35:42
191
原创 LeetCode 1143. Longest Common Subsequence
[Med] LeetCode 1143. Longest Common Subsequence链接: https://leetcode.com/problems/longest-common-subsequence/题目描述:Given two strings text1 and text2, return the length of their longest common subseq...
2020-04-26 23:58:25
256
原创 LeetCode 855. Exam Room
[Med] LeetCode 855. Exam Room链接: https://leetcode.com/problems/exam-room/题目描述:In an exam room, there are N seats in a single row, numbered 0, 1, 2, …, N-1.When a student enters the room, they mu...
2020-04-26 05:25:19
358
原创 LeetCode 849. Maximize Distance to Closest Person
[Easy] LeetCode 849. Maximize Distance to Closest Person链接: https://leetcode.com/problems/maximize-distance-to-closest-person/题目描述:In a row of seats, 1 represents a person sitting in that seat, an...
2020-04-26 02:58:04
185
原创 LeetCode 146. LRU Cache
[Med] LeetCode 146. LRU Cache链接: https://leetcode.com/problems/lru-cache/题目描述:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:...
2020-04-25 02:17:36
129
原创 LeetCode 1155. Number of Dice Rolls With Target Sum
[Med] LeetCode 1155. Number of Dice Rolls With Target Sum链接: https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/题目描述:You have d dice, and each die has f faces numbered 1, 2, …, f....
2020-04-24 07:50:32
316
原创 LeetCode 201. Bitwise AND of Numbers Range
[Med] LeetCode 201. Bitwise AND of Numbers Range链接: https://leetcode.com/problems/bitwise-and-of-numbers-range/题目描述:Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwis...
2020-04-24 06:27:20
190
原创 LeetCode 1021. Remove Outermost Parentheses
[Easy] LeetCode 1021. Remove Outermost Parentheses链接: https://leetcode.com/problems/remove-outermost-parentheses/题目描述:A valid parentheses string is either empty (""), “(” + A + “)”, or A + B, wher...
2020-04-23 08:49:32
207
原创 LeetCode 938. Range Sum of BST
[Med] LeetCode 938. Range Sum of BST链接: https://leetcode.com/problems/range-sum-of-bst/题目描述:Given the root node of a binary search tree, return the sum of values of all nodes with value between L ...
2020-04-23 06:43:10
163
原创 LeetCode 1218. Longest Arithmetic Subsequence of Given Difference
[Med] LeetCode 1218. Longest Arithmetic Subsequence of Given Difference链接: https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference/题目描述:Given an integer array arr and an i...
2020-04-23 06:08:11
272
原创 LeetCode 1325. Delete Leaves With a Given Value
[Med] LeetCode 1325. Delete Leaves With a Given Value链接: https://leetcode.com/problems/delete-leaves-with-a-given-value/题目描述:Given a binary tree root and an integer target, delete all the leaf nod...
2020-04-23 05:41:32
243
原创 LeetCode 560. Subarray Sum Equals K
[Med] LeetCode 560. Subarray Sum Equals K链接: https://leetcode.com/problems/subarray-sum-equals-k/题目描述:Given an array of integers and an integer k, you need to find the total number of continuous s...
2020-04-23 05:19:57
183
原创 LeetCode 1340. Jump Game V
[Hard] LeetCode Jump Game V链接: https://leetcode.com/problems/jump-game-v/题目描述:Given an array of integers arr and an integer d. In one step you can jump from index i to index:i + x where: i + x &l...
2020-04-22 13:19:29
353
原创 LeetCode 1342. Number of Steps to Reduce a Number to Zero
[Easy] LeetCode 1342. Number of Steps to Reduce a Number to Zero链接: https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/题目描述:Given a non-negative integer num, return the numbe...
2020-04-22 13:08:54
219
原创 LeetCode 1347. Minimum Number of Steps to Make Two Strings Anagram
[Med] LeetCode 1347. Minimum Number of Steps to Make Two Strings Anagram链接: https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram/题目描述:Given two equal-size strings s an...
2020-04-22 12:20:32
473
原创 LeetCode 1254. Number of Closed Islands
[Med] 1254. Number of Closed IslandsLeetCode链接: https://leetcode.com/problems/number-of-closed-islands/题目描述:Given a 2D grid consists of 0s (land) and 1s (water). An island is a maximal 4-directio...
2020-04-22 07:57:36
283
原创 LeetCode 1419. Minimum Number of Frogs Croaking
[Med] LeetCode 1419. Minimum Number of Frogs Croaking链接: https://leetcode.com/problems/minimum-number-of-frogs-croaking/题目描述:Given the string croakOfFrogs, which represents a combination of the st...
2020-04-22 07:42:43
790
原创 LeeCode 1418. Display Table of Food Orders in a Restaurant
[Med] LeetCode 1418. Display Table of Food Orders in a Restaurant链接: https://leetcode.com/problems/display-table-of-food-orders-in-a-restaurant/Medium:题目描述:Given the array orders, which represent...
2020-04-21 09:47:56
524
原创 LeetCode 1417. Reformat The String
[Easy] LeetCode 1417. Reformat The String链接: https://leetcode.com/problems/reformat-the-string/题目描述:Given alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English le...
2020-04-21 08:26:28
411
原创 LeetCode 1008. Construct Binary Search Tree from Preorder Traversal
[Med] LeetCode 1008. Construct Binary Search Tree from Preorder Traversal加粗样式链接:https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/题目描述:Return the root node of a b...
2020-04-21 07:17:28
268
原创 LeetCode 1365. How Many Numbers Are Smaller Than the Current Number
[Easy] LeetCode链接:https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/题目描述Given the array nums, for each nums[i] find out how many numbers in the array are smaller t...
2020-04-20 06:12:39
357
原创 Leetcode 1376. Time Needed to Inform All Employees
[Med] LeetCode 1376. Time Needed to Inform All Employees链接:https://leetcode.com/problems/time-needed-to-inform-all-employees/题目描述A company has n employees with a unique ID for each employee from 0...
2020-04-20 06:08:49
811
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人