LeetCode solutions
Every LeetCode problem I have solved, with the accepted code in each language I solved it in. The problem statements stay on LeetCode where they belong — what is here is the solution, the runtime it was accepted at, and a link to the repository it came from.
1,055 solutions
Showing 1–50 of 140 solutions matching Hard, filtered from 1,055.
- 10. Regular Expression Matching Hard Languages: Python Accepted runtime 8ms
- 115. Distinct Subsequences Hard Languages: Python Accepted runtime 198ms
- 123. Best Time to Buy and Sell Stock III Hard Languages: Python Accepted runtime 218ms
- 124. Binary Tree Maximum Path Sum Hard Languages: Python Accepted runtime 25ms
- 126. Word Ladder II Hard Languages: Python Accepted runtime 32ms
- 127. Word Ladder Hard Languages: Python Accepted runtime 39ms
- 1000. Delete Columns to Make Sorted III Hard Languages: Python Accepted runtime 57ms
- 1008. Binary Tree Cameras Hard Languages: Python Accepted runtime 0ms
- 1012. Equal Rational Numbers Hard Languages: Python Accepted runtime 0ms
- 1017. Odd Even Jump Hard Languages: Python Accepted runtime 111ms
- 1022. Unique Paths III Hard Languages: Python Accepted runtime 7ms
- 1024. Triples with Bitwise AND Equal To Zero Hard Languages: Python Accepted runtime 2865ms
- 1029. Vertical Order Traversal of a Binary Tree Hard Languages: Python Accepted runtime 0ms
- 1034. Subarrays with K Different Integers Hard Languages: C++ Accepted runtime 51ms
- 1037. Minimum Number of K Consecutive Bit Flips Hard Languages: Python Accepted runtime 255ms
- 1038. Number of Squareful Arrays Hard Languages: Python Accepted runtime 4ms
- 1042. Minimum Cost to Merge Stones Hard Languages: Python Accepted runtime 1ms
- 1043. Grid Illumination Hard Languages: Python Accepted runtime 187ms
- 1057. Numbers With Repeated Digits Hard Languages: Python Accepted runtime 0ms
- 1093. Recover a Tree From Preorder Traversal Hard Languages: Python Accepted runtime 21ms
- 1097. Stream of Characters Hard Languages: Python Accepted runtime 284ms
- 1106. Escape a Large Maze Hard Languages: Python Accepted runtime 203ms
- 1122. Longest Duplicate Substring Hard Languages: Python Accepted runtime 980ms
- 1133. Last Substring in Lexicographical Order Hard Languages: Python Accepted runtime 156ms
- 1145. Number of Submatrices That Sum to Target Hard Languages: Python Accepted runtime 369ms
- 1170. Shortest Common Supersequence Hard Languages: Python Accepted runtime 406ms
- 1185. Find in Mountain Array Hard Languages: Python Accepted runtime 28ms
- 1188. Brace Expansion II Hard Languages: Python Accepted runtime 3ms
- 1197. Parsing A Boolean Expression Hard Languages: Python Accepted runtime 14ms
- 1220. Smallest Sufficient Team Hard Languages: Python Accepted runtime 95ms
- 1224. Minimum Falling Path Sum II Hard Languages: C++ Accepted runtime 0ms
- 1251. Longest Chunked Palindrome Decomposition Hard Languages: Python Accepted runtime 0ms
- 1262. Online Majority Element In Subarray Hard Languages: Python Accepted runtime 534ms
- 1277. Largest Multiple of Three Hard Languages: Python Accepted runtime 18ms
- 1286. Constrained Subsequence Sum Hard Languages: Python Accepted runtime 323ms
- 1300. Critical Connections in a Network Hard Languages: Python Accepted runtime 267ms
- 1451. Minimum Number of Taps to Open to Water a Garden Hard Languages: Python Accepted runtime 24ms
- 1457. Minimum Difficulty of a Job Schedule Hard Languages: C++ Accepted runtime 16ms
- 1461. Count All Valid Pickup and Delivery Options Hard Languages: Python Accepted runtime 0ms
- 1471. Maximum Students Taking Exam Hard Languages: Python Accepted runtime 8ms
- 1485. Minimum Cost to Make at Least One Valid Path in a Grid Hard Languages: Python Accepted runtime 90ms
- 1508. Longest Happy Prefix Hard Languages: Python Accepted runtime 93ms
- 1517. Restore The Array Hard Languages: Python Accepted runtime 719ms
- 1522. Stone Game III Hard Languages: C++ Accepted runtime 11ms
- 1527. Number of Ways to Paint N × 3 Grid Hard Languages: Python Accepted runtime 7ms
- 1535. Build Array Where You Can Find The Maximum Exactly K Comparisons Hard Languages: Python Accepted runtime 1563ms
- 1555. Number of Ways of Cutting a Pizza Hard Languages: C++ Accepted runtime 7ms
- 1613. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree Hard Languages: Python Accepted runtime 534ms
- 1638. Best Position for a Service Centre Hard Languages: Python Accepted runtime 107ms
- 1644. Maximum Number of Non-Overlapping Substrings Hard Languages: Python Accepted runtime 263ms
Page 1 of 3
These are practice solutions, not lessons. If you came here to learn how any of it works, the explanations live in the lessons.