- 博客(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
331
原创 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
537
原创 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 operations required to convert word1 to word2. You have the following 3 operations permitted on a word: I
2020-06-01 04:58:20
332
原创 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
482
原创 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
426
原创 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: 2 Explanation: 1 and 2 are counted c
2020-05-25 01:54:25
422
原创 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
398
原创 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
836
原创 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
348
原创 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
309
原创 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
465
原创 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
1296
原创 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 digits from the number so that the new number is the smallest possible. Example 1: Input: num
2020-05-14 06:08:46
246
原创 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
257
原创 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: true Explanation: “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
384
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
296
原创 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
242
原创 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
209
原创 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
266
原创 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
335
原创 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
478
原创 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
274
原创 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
187
原创 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
443
原创 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
313
原创 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
292
原创 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
238
原创 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
367
原创 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
347
原创 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
305
原创 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
456
原创 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
304
原创 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
579
原创 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
430
原创 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
924
原创 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
637
原创 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
522
原创 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
345
原创 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
450
原创 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
940
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅