- 博客(42)
- 收藏
- 关注

原创 LeetCode 题目讲解集合
LeetCode 题目集合题号难度正文1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
2020-04-21 07:38:08
254
原创 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
430
原创 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
254
原创 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
394
原创 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
344
原创 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
344
原创 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
307
原创 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
751
原创 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
264
原创 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
242
原创 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
379
原创 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
1214
原创 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
194
原创 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
194
原创 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
326
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
245
原创 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
188
原创 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
142
原创 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
218
原创 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
278
原创 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
388
原创 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
223
原创 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
150
原创 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
363
原创 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
218
原创 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
236
原创 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
187
原创 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
299
原创 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
280
原创 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
215
原创 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
385
原创 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
244
原创 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
510
原创 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
347
原创 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
835
原创 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
547
原创 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
453
原创 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
290
原创 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
387
原创 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
845
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人