#Medium
248 posts
LintCode 960 First Unique Number In Data Stream II - Medium
960. First Unique Number in Data Stream II
LintCode 92 Backpack - Medium
描述
LintCode 90 K Sum II - Medium
90. k Sum II
LintCode 843 Digits Flip - Medium
LintCode 761 Smallest Subset - Medium
761. Smallest Subset
LintCode 752 Rogue Knight Sven - Medium
752. 流浪剑客斯温
LintCode 724 Minimum Partition - Medium
724. Minimum Partition
LintCode 685 First Unique Number In Data Stream - Medium
685. First Unique Number in Data Stream
LintCode 680 Split String - Medium
680. Split String
LintCode 654 Sparse Matrix Multiplication - Medium
654. Sparse Matrix Multiplication
LintCode 630 Knight Shortest Path II - Medium
630. Knight Shortest Path II
LintCode 625 Partition Array II - Medium
625. Partition Array II
LintCode 612 K Closest Points - Medium
612. K Closest Points
LintCode 611 Knight Shortest Path-II - Medium
611. Knight Shortest Path
LintCode 610 Two Sum-Difference Equals To Target - Medium
610. Two Sum - Difference equals to target
LintCode 61 Search For A Range - Medium
61. Search for a Range
LintCode 609 Two Sum-Less Than Or Eqaul To Target - Medium
609. Two Sum - Less than or equal to target
LintCode 585 Maximum Number In Mountain Sequence - Medium
585. Maximum Number in Mountain Sequence
LintCode 584 Drop Eggs II - Medium
584. Drop Eggs II
LintCode 578 Lowest Common Ancestor III - Medium
578. Lowest Common Ancestor III
LintCode 577 Merge K Sorted Interval Lists - Medium
577. Merge K Sorted Interval Lists
LintCode 563 Backpack V - Medium
描述
LintCode 553 Two Sum-Closest To Target - Medium
533. Two Sum - Closest to target
LintCode 545 Top K Largest Numbers II - Medium
545. Top k Largest Numbers II
LintCode 538 Memcache - Medium
538. Memcache
LintCode 522 Tiny URLII - Medium
522. Tiny Url II
LintCode 502 Mini Cassandra - Medium
502. Mini Cassandra
LintCode 49 Sort Letters By Case - Medium
49. Sort Letters by Case
LintCode 461 Kth Smallest Numbers In Unsorted Array - Medium
Find the kth smallest number in an unsorted integer array.
LintCode 460 Find K Closest Elements - Medium
460. Find K Closest Elements
LintCode 447 Search In A Big Sorted Array - Medium
447. Search in a Big Sorted Array
LintCode 443 Two Sum-Greater Than Target - Medium
443. Two Sum - Greater than target
LintCode 440 Backpack III - Medium
给定 n 种物品, 每种物品都有无限个. 第 i 个物品的体积为 A[i], 价值为 V[i].
LintCode 437 Copy Books - Medium
给定 n 本书, 第 i 本书的页数为 pages[i]. 现在有 k 个人来复印这些书籍, 而每个人只能复印编号连续的一段的书, 比如一个人可以复印 pages[0], pages[1], pages[2], 但是不可以只复印 pages[0], pages[2], pa…
LintCode 40 Implement Queue By Two Stacks - Medium
40. Implement Queue by Two Stacks
LintCode 394 Coin In Line - Medium
描述
LintCode 38 Search A2 D Matrix II - Medium
38. Search a 2D Matrix II
LintCode 197 Permutation Index - Medium
197. Permutation Index
LintCode 1870 Number Of Substrings With All Zeroes - Medium
1870. number of substrings with all zeroes
LintCode 144 Interleaving Positive And Negative Numbers - Medium
144. Interleaving Positive and Negative Numbers
LintCode 143 Sort Colors II - Medium
LintCode 140 Fast Power - Medium
140. Fast Power
LintCode 1375 Substring With At Least K Distinct Characters - Medium
1375. Substring With At Least K Distinct Characters
LintCode 130 Heapify - Medium
130. Heapify
LintCode 129 Rehashing - Medium
129. Rehashing
LintCode 127 Topological Sorting - Medium
127. Topological Sorting
LintCode 125 Backpack II - Medium
有 n 个物品和一个大小为 m 的背包. 给定数组 A 表示每个物品的大小和数组 V 表示每个物品的价值.
LintCode 10 String Permutations II - Medium
10. String Permutation II
LeetCode 994 Rotting Oranges - Medium
994. Rotting Oranges -- Medium
LeetCode 991 Broken Calculator - Medium
991. Broken Calculator -- Medium
LeetCode 987 Vertical Order Traversal Of A Binary Tree - Medium
987. Vertical Order Traversal of a Binary Tree -- Medium
LeetCode 986 Interval List Intersections - Medium
986. Interval List Intersections
LeetCode 983 Minimum Cost For Tickets - Medium
983. Minimum Cost For Tickets -- Medium
LeetCode 981 Time Based Key Value Store - Medium
981. Time Based Key-Value Store -- Medium
LeetCode 98 Valid Binary Search Tree - Medium
98. Validate Binary Search Tree -- Medium
LeetCode 974 Subarray Sums Divisible By K - Medium
974. Subarray Sums Divisible by K -- Medium
LeetCode 973 K Closest Points To Origin - Medium
973. K Closest Points to Origin -- Medium
LeetCode 969 Pancake Sorting - Medium
969. Pancake Sorting
LeetCode 96 Unique Binary Search Trees - Medium
96. Unique Binary Search Trees -- Medium
LeetCode 958 Check Completeness Of A Binary Tree - Medium
958. Check Completeness of a Binary Tree -- Medium
LeetCode 950 Reveal Cards In Increasing Order - Medium
950. Reveal Cards In Increasing Order -- Medium
LeetCode 95 Unique Binary Search Trees II - Medium
95. Unique Binary Search Trees II -- Medium
LeetCode 94 Binary Tree Inorder Traversal - Medium
94. Binary Tree Inorder Traversal
LeetCode 931 Minimum Falling Path Sum - Medium
931. Minimum Falling Path Sum -- Medium
LeetCode 92 Reverse Linked List II - Medium
92. Reverse Linked List II
LeetCode 912 Sort An Array - Medium
Given an array of integers nums, sort the array in ascending order.
LeetCode 91 Decode Ways - Medium
A message containing letters from A-Z is being encoded to numbers using the following mapping:
LeetCode 889 Construct Binary Tree From Preorder And Postorder Traversal - Medium
889. Construct Binary Tree from Preorder and Postorder Traversal
LeetCode 883 Find And Replace In String - Medium
833. Find And Replace in String
LeetCode 881 Boats To Save People - Medium
881. Boats to Save People -- Medium
LeetCode 870 Advantage Shuffle - Medium
870. Advantage Shuffle -- Medium
LeetCode 863 All Nodes Distance K In Binary Tree - Medium
863. All Nodes Distance K in Binary Tree -- Medium
LeetCode 86 Partition List - Medium
86. Partition List
LeetCode 856 Score Of Parentheses - Medium
856. Score of Parentheses -- Medium
LeetCode 853 Car Fleet - Medium
853. Car Fleet -- Medium
LeetCode 837 New21 Game - Medium
837. New 21 Game -- Medium
LeetCode 822 Card Flipping Game - Medium
822. Card Flipping Game -- Medium
LeetCode 82 Remove Duplicates From Sorted List II - Medium
82. Remove Duplicates from Sorted List II
LeetCode 79 Word Search - Medium
79. Word Search -- Medium
LeetCode 785 Is Graph Bipatite - Medium
785. Is Graph Bipartite? -- Medium
LeetCode 78 Subsets - Medium
17. Subsets
LeetCode 777 Swap Adjacent In LR String - Medium
777. Swap Adjacent in LR String -- Medium
LeetCode 767 Reorganize String - Medium
767. Reorganize String -- Medium
LeetCode 763 Partition Labels - Medium
763. Partition Labels
LeetCode 75 Sort Colors - Medium
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the col…
LeetCode 74 Search A2 D Matrix - Medium
74. Search a 2D Matrix
LeetCode 735 Asteroid Collision - Medium
735. Asteroid Collision -- Medium
LeetCode 723 Candy Crush - Medium
723. Candy Crush -- Medium
LeetCode 713 Subarray Product Less Than K - Medium
713. Subarray Product Less Than K -- Medium
LeetCode 698 Partition To K Equal Sum Subsets - Medium
698. Partition to K Equal Sum Subsets -- Medium
LeetCode 695 Max Area Of Island - Medium
695. Max Area of Island -- Medium
LeetCode 692 Top K Frequent Words - Medium
692. Top K Frequent Words
LeetCode 681 Next Closest Time - Medium
681. Next Closest Time -- Medium
LeetCode 670 Maximum Swap - Medium
670. Maximum Swap -- Medium
LeetCode 662 Maximum Width Of Binary Tree - Medium
662. Maximum Width of Binary Tree -- Medium
LeetCode 658 Find K Closest Elements - Medium
658. Find K Closest Elements
LeetCode 647 Palindromic Substrings - Medium
647. Palindromic Substrings
LeetCode 64 Minimum Path Sum - Medium
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers alo…
LeetCode 63 Unique Paths II - Medium
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
LeetCode 621 Task Scheduler - Medium
621. Task Scheduler -- Medium
LeetCode 62 Unique Paths - Medium
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
LeetCode 611 Valid Triangle Number - Medium
611. Valid Triangle Number
LeetCode 61 Rotate List - Medium
61. Rotate List -- Medium
LeetCode 582 Kill Process - Medium
582. Kill Process -- Medium
LeetCode 567 Permutation In String - Medium
567. Permutation in String -- Medium
LeetCode 56 Merge Intervals - Medium
56. Merge Intervals
LeetCode 55 Jump Game - Medium
Given an array of non-negative integers, you are initially positioned at the first index of the array.
LeetCode 547 Friend Circles - Medium
547. Friend Circles
LeetCode 545 Boundary Of Binary Tree - Medium
545. Boundary of Binary Tree -- Medium
LeetCode 542 01 Matrix - Medium
542. 01 Matrix
LeetCode 535 Encode And Decode Tiny URL - Medium
535. Encode and Decode TinyURL
LeetCode 529 Minesweeper - Medium
529. Minesweeper -- Medium
LeetCode 528 Random Pick With Weight - Medium
528. Random Pick with Weight -- Medium
LeetCode 526 Beautiful Arrangement - Medium
526. Beautiful Arrangement
LeetCode 523 Continuous Subarray Sum - Medium
523. Continuous Subarray Sum -- Medium
LeetCode 518 Coin Change II - Medium
518. Coin Change 2 -- Medium
LeetCode 516 Longest Palindromic Subsequence - Medium
516. Longest Palindromic Subsequence
LeetCode 50 Pow(x,n) - Medium
50. Pow(x, n)
LeetCode 49 Group Anagrams - Medium
Given an array of strings, group anagrams together.
LeetCode 48 Rotate Image - Medium
48. Rotate Image
LeetCode 474 Onesand Zeroes - Medium
Given an array, strs, with strings consisting of only 0s and 1s. Also two integers m and n.
LeetCode 470 Implement Rand10()Using Rand7() - Medium
470. Implement Rand10() Using Rand7() -- Medium
LeetCode 47 Permutations II - Medium
47. Permutations II
LeetCode 454 4 Sum II - Medium
454. 4Sum II
LeetCode 451 Sort Characters By Frequency - Medium
451. Sort Characters By Frequency -- Medium
LeetCode 450 Delete Node In ABST - Medium
450. Delete Node in a BST -- Medium
LeetCode 449 Serialize And Deserialize BST - Medium
449. Serialize and Deserialize BST
LeetCode 445 Add Two Numbers II - Medium
445. Add Two Numbers II -- Medium
LeetCode 437 Path Sum III - Medium
437. Path Sum III -- Medium
LeetCode 430 Flatten A Multilevel Doubly Linked List - Medium
430. Flatten a Multilevel Doubly Linked List -- Medium
LeetCode 43 Multiply Strings - Medium
43. Multiply Strings -- Medium
LeetCode 424 Longest Repeating Character Replacement - Medium
424. Longest Repeating Character Replacement
LeetCode 417 Pacific Atlantic Water Flow - Medium
417. Pacific Atlantic Water Flow -- Medium
LeetCode 406 Queue Reconstruction By Height - Medium
406. Queue Reconstruction by Height -- Medium
LeetCode 402 Remove K Digits - Medium
402. Remove K Digits -- Medium
LeetCode 40 Combination Sum II - Medium
40. Combination Sum II
LeetCode 398 Evaluate Division - Medium
399. Evaluate Division -- Medium
LeetCode 395 Longest Substring With At Least K Repeating Characters - Medium
395. Longest Substring with At Least K Repeating Characters -- Medium
LeetCode 394 Decode String - Medium
394. Decode String -- Medium
LeetCode 390 Elimination Game - Medium
390. Elimination Game -- Medium
LeetCode 39 Combination Sum - Medium
39. Combination Sum
LeetCode 386 Lexicographical Numbers - Medium
386. Lexicographical Numbers -- Medium
LeetCode 384 Shuffle An Array - Medium
384. Shuffle an Array -- Medium
LeetCode 380 Insert Delete Get Random O(1) - Medium
380. Insert Delete GetRandom O(1)
LeetCode 378 Kth Smallest Element In A Sorted Matrix - Medium
378 Kth Smallest Element in a Sorted Matrix
LeetCode 377 Combination Sum IV - Medium
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive in…
LeetCode 361 Bomb Enemy - Medium
LeetCode 36 Valid Sudoku - Medium
36. Valid Sudoku -- Medium
LeetCode 355 Design Twitter - Medium
355. Design Twitter
LeetCode 347 Top K Frequent Elements - Medium
347. Top K Frequent Elements -- Medium
LeetCode 34 Find First And Last Position Of Element In Sorted Array - Medium
34. Find First and Last Position of Element in Sorted Array
LeetCode 338 Counting Bits - Medium
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary represe…
LeetCode 33 Search In Rotated Sorted Array - Medium
33. Search in Rotated Sorted Array
LeetCode 325 Maximum Size Subarray Sum Equals K - Medium
325. Maximum Size Subarray Sum Equals k
LeetCode 323 Number Of Connected Components In An Undirected Graph - Medium
323. Number of Connected Components in an Undirected Graph -- Medium
LeetCode 322 Coin Change - Medium
LeetCode 320 Generalized Abbreviation - Medium
320. Generalized Abbreviation -- Medium
LeetCode 316 Remove Duplicate Letters - Medium
316. Remove Duplicate Letters -- Medium
LeetCode 314 Binary Tree Vertical Order Traversal - Medium
314. Binary Tree Vertical Order Traversal -- Medium
LeetCode 31 Next Permutation - Medium
31. Next Permutation
LeetCode 300 Longest Increasing Subsequence - Medium
Given an unsorted array of integers, find the length of longest increasing subsequence.
LeetCode 29 Divide Two Integers - Medium
29. Divide Two Integers
LeetCode 286 Walls And Gates - Medium
286. Walls and Gates -- Medium
LeetCode 279 Perfect Squares - Medium
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.
LeetCode 264 Ugly Number II - Medium
264. Ugly Number II
LeetCode 255 Verify Preorder Sequence In Binary Search Tree - Medium
255. Verify Preorder Sequence in Binary Search Tree -- Medium
LeetCode 253 Meeting Rooms II - Medium
253. Meeting Rooms II -- Medium
LeetCode 240 Search A2 D Matrix II - Medium
240. Search a 2D Matrix II
LeetCode 24 Swap Nodes In Pairs - Medium
24. Swap Nodes in Pairss
LeetCode 238 Product Of Array Except Self - Medium
238. Product of Array Except Self -- Medium
LeetCode 236 Lowest Common Ancestor Of A Binary Tree - Medium
236. Lowest Common Ancestor of a Binary Tree
LeetCode 230 Kth Smallest Element Ina BST - Medium
230. Kth Smallest Element in a BST
LeetCode 229 Majority Element II - Medium
229. Majority Element II
LeetCode 227 Basic Calculator II - Medium
227. Basic Calculator II -- Medium
LeetCode 222 Count Complete Tree Nodes - Medium
222. Count Complete Tree Nodes -- Medium
LeetCode 221 Maximal Square - Medium
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
LeetCode 220 Contains Duplicate III - Medium
220. Contains Duplicate III -- Medium
LeetCode 22 Generate Parentheses - Medium
22. Generate Parentheses
LeetCode 215 Kth Largest Element In An Array - Medium
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct elem…
LeetCode 210 Course Schedule II - Medium
210. Course Schedule II
LeetCode 209 Minimum Size Subarray Sum - Medium
209. Minimum Size Subarray Sum
LeetCode 207 Course Schedule - Medium
207. Course Schedule
LeetCode 200 Number Of Islands - Medium
200. Number of Islands
LeetCode 19 Remove Nth Node From End Of List - Medium
19. Remove Nth Node From End of List
LeetCode 189 Rotate Array - Medium
189. Rotate Array -- Medium
LeetCode 18 4 Sum - Medium
18. 4Sum
LeetCode 179 Largest Number - Medium
179. Largest Number -- Medium
LeetCode 173 Binary Search Tree Iterator - Medium
173. Binary Search Tree Iterator
LeetCode 17 Letter Combinations Of A Phone Number - Medium
17. Letter Combinations of a Phone Number
LeetCode 166 Fraction To Recurring Decimal - Medium
166. Fraction to Recurring Decimal -- Medium
LeetCode 162 Find Peak Element - Medium
162. Find Peak Element
LeetCode 16 3 Sum Closest - Medium
16. 3Sum Closest
LeetCode 1583 Count Unhappy Friends - Medium
1583. Count Unhappy Friends -- Medium
LeetCode 1522 Diameter Of N-Ary Tree - Medium
1522. Diameter of N-Ary Tree -- Medium
LeetCode 152 Maximum Product Subarry - Medium
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product.
LeetCode 151 Reverse Words In A String - Medium
151. Reverse Words in a String
LeetCode 15 3 Sum - Medium
15. 3Sum
LeetCode 1481 Least Number Of Unique Integers After K Removals - Medium
1481. Least Number of Unique Integers after K Removals -- Medium
LeetCode 1472 Design Browser History - Medium
1472. Design Browser History -- Medium
LeetCode 1465 Maximum Area Of A Piece Of Cake After Horizontal And Vertical Cuts - Medium
1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts -- Medium
LeetCode 146 LRU Cache - Medium
146. LRU Cache
LeetCode 1457 Pseudo-Palindromic Paths In A Binary Tree - Medium
1457. Pseudo-Palindromic Paths in a Binary Tree
LeetCode 1456 Maximum Number Of Vowels In A Substring Of Given Length - Medium
1456. Maximum Number of Vowels in a Substring of Given Length
LeetCode 144 Binary Tree Preorder Traversal - Medium
144. Binary Tree Preorder Traversal
LeetCode 143 Reorder List - Medium
143. Reorder List -- Medium
LeetCode 1429 First Unique Number - Medium
1429. First Unique Number -- Medium
LeetCode 1423 Maximum Points You Can Obtain From Cards - Medium
1423. Maximum Points You Can Obtain from Cards -- Medium
LeetCode 142 Linked List Cycle II - Medium
142. Linked List Cycle II
LeetCode 1396 Design Underground System - Medium
1396. Design Underground System -- Medium
LeetCode 138 Copy List With Random Pointer - Medium
138. Copy List with Random Pointer -- Medium
LeetCode 1376 Time Needed To Inform All Employees - Medium
1376. Time Needed to Inform All Employees -- Medium
LeetCode 1375 Bulb Switcher III - Medium
1375. Bulb Switcher III -- Medium
LeetCode 1366 Rank Teams By Votes - Medium
1366. Rank Teams by Votes -- Medium
LeetCode 1361 Valid Binary Tree Nodes - Medium
1361. Validate Binary Tree Nodes (Pony.ai CHINA VO)
LeetCode 1352 Product Of The Last K Numbers - Medium
1352. Product of the Last K Numbers -- Medium
LeetCode 1347 Minimum Number Of Steps To Make Two Strings Anagram - Medium
1347. Minimum Number of Steps to Make Two Strings Anagram -- Medium
LeetCode 134 Gas Station - Medium
LeetCode 1339 Maximum Product Of Splitted Binary Tree - Medium
1339. Maximum Product of Splitted Binary Tree -- Medium
LeetCode 1334 Find The City With The Smallest Number Of Neighbors At A Threshold Distance - Medium
1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance -- Medium
LeetCode 133 Clone Graph - Medium
133. Clone Graph
LeetCode 130 Surrounded Regions - Medium
130. Surrounded Regions -- Medium
LeetCode 127 Word Ladder - Medium
127. Word Ladder
LeetCode 1262 Greatest Sum Divisible By Three - Medium
1262. Greatest Sum Divisible by Three -- Medium
LeetCode 1254 Number Of Closed Islands - Medium
1254. Number of Closed Islands -- Medium
LeetCode 1249 Minimum Remove To Make Valid Parentheses - Medium
1249. Minimum Remove to Make Valid Parentheses -- Medium
LeetCode 1244 Design A Leaderboard - Medium
1244. Design A Leaderboard -- Medium
LeetCode 1214 Two Sum BS Ts - Medium
1214. Two Sum BSTs -- Medium
LeetCode 1209 Remove All Adjacent Duplicates In String - Medium
1209. Remove All Adjacent Duplicates in String II -- Medium
LeetCode 1202 Smallest String With Swaps - Medium
1202. Smallest String With Swaps -- Medium
LeetCode 12 Integer To Roman - Medium
12. Integer to Roman
LeetCode 1197 Minimum Knight Moves - Medium
1197. Minimum Knight Moves
LeetCode 1188 Design Bounded Blocking Queue - Medium
1188. Design Bounded Blocking Queue -- Medium
LeetCode 117 Populating Next Right Pointers In Each Node II - Medium
117. Populating Next Right Pointers in Each Node II -- Medium
LeetCode 1169 Invalid Transactions - Medium
1169. Invalid Transactions -- Medium
LeetCode 1156 Swap For Longest Repeated Character Substring - Medium
1156. Swap For Longest Repeated Character Substring -- Medium
LeetCode 1143 Longest Common Subsequence - Medium
Given two strings text1 and text2, return the length of their longest common subsequence.
LeetCode 114 Flatten Binary Tree To Linked List - Medium
114. Flatten Binary Tree to Linked List
LeetCode 1130 Minimum Cost Tree From Leaf Values - Medium
1130. Minimum Cost Tree From Leaf Values
LeetCode 1092 Two City Scheduling - Medium
1029. Two City Scheduling -- Medium
LeetCode 1081 Smallest Subsequence Of Distinct Characters - Medium
1081. Smallest Subsequence of Distinct Characters -- Medium
LeetCode 1057 Campus Bikes - Medium
1057. Campus Bikes -- Medium
LeetCode 1054 Distant Barcodes - Medium
1054. Distant Barcodes -- Medium
LeetCode 1052 Grumpy Bookstore Owner - Medium
1052. Grumpy Bookstore Owner
LeetCode 1049 Last Stone Weight II - Medium
1049. Last Stone Weight II -- Medium
LeetCode 1031 Maximum Sum Of Two Non-Overlapping Subarrays - Medium
LeetCode 103 Binary Tree Zigzag Level Order Traversal - Medium
103. Binary Tree Zigzag Level Order Traversal
LeetCode 102 Binary Tree Level Order Traversal - Medium
102. Binary Tree Level Order Traversal
LeetCode 1008 Construct Binary Search Tree From Preorder Traversal - Medium
1008. Construct Binary Search Tree from Preorder Traversal -- Medium