Skip to content

davideruby/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

All my solved Leetcode problems.

My Leetcode profile: https://leetcode.com/u/daviderubi/

Name Difficulty Solution
2. Add Two Numbers ${\textsf{\color{yellow}Medium}}$ Solution
5. Longest Palindromic Substring ${\textsf{\color{yellow}Medium}}$ Solution
7. Reverse Integer ${\textsf{\color{yellow}Medium}}$ Solution
10. Regular Expression Matching ${\textsf{\color{red}Hard}}$ Solution
11. Container With Most Water ${\textsf{\color{yellow}Medium}}$ Solution
15. 3Sum ${\textsf{\color{yellow}Medium}}$ Solution
17. Letter Combinations of a Phone Number ${\textsf{\color{yellow}Medium}}$ Solution
19. Remove Nth Node From End of List ${\textsf{\color{yellow}Medium}}$ Solution
20. Valid Parentheses ${\textsf{\color{green}Easy}}$ Solution
21. Merge Two Sorted Lists ${\textsf{\color{green}Easy}}$ Solution
22. Generate Parentheses ${\textsf{\color{yellow}Medium}}$ Solution
23. Merge k Sorted Lists ${\textsf{\color{red}Hard}}$ Solution
26. Remove Duplicates from Sorted Array ${\textsf{\color{green}Easy}}$ Solution
33. Search in Rotated Sorted Array ${\textsf{\color{yellow}Medium}}$ Solution
36. Valid Sudoku ${\textsf{\color{yellow}Medium}}$ Solution
39. Combination Sum ${\textsf{\color{yellow}Medium}}$ Solution
40. Combination Sum II ${\textsf{\color{yellow}Medium}}$ Solution
42. Trapping Rain Water ${\textsf{\color{red}Hard}}$ Solution
45. Jump Game II ${\textsf{\color{yellow}Medium}}$ Solution
46. Permutations ${\textsf{\color{yellow}Medium}}$ Solution
49. Group Anagrams ${\textsf{\color{yellow}Medium}}$ Solution
51. N-Queens ${\textsf{\color{red}Hard}}$ Solution
53. Maximum Subarray ${\textsf{\color{yellow}Medium}}$ Solution
55. Jump Game ${\textsf{\color{yellow}Medium}}$ Solution
62. Unique Paths ${\textsf{\color{yellow}Medium}}$ Solution
66. Plus One ${\textsf{\color{green}Easy}}$ Solution
70. Climbing Stairs ${\textsf{\color{green}Easy}}$ Solution
72. Edit Distance ${\textsf{\color{yellow}Medium}}$ Solution
74. Search a 2D Matrix ${\textsf{\color{yellow}Medium}}$ Solution
76. Minimum Window Substring ${\textsf{\color{red}Hard}}$ Solution
77. Combinations ${\textsf{\color{yellow}Medium}}$ Solution
78. Subsets ${\textsf{\color{yellow}Medium}}$ Solution
79. Word Search ${\textsf{\color{yellow}Medium}}$ Solution
84. Largest Rectangle in Histogram ${\textsf{\color{red}Hard}}$ Solution
90. Subsets II ${\textsf{\color{yellow}Medium}}$ Solution
91. Decode Ways ${\textsf{\color{yellow}Medium}}$ Solution
97. Interleaving String ${\textsf{\color{yellow}Medium}}$ Solution
98. Validate Binary Search Tree ${\textsf{\color{yellow}Medium}}$ Solution
100. Same Tree ${\textsf{\color{green}Easy}}$ Solution
102. Binary Tree Level Order Traversal ${\textsf{\color{yellow}Medium}}$ Solution
104. Maximum Depth of Binary Tree ${\textsf{\color{green}Easy}}$ Solution
105. Construct Binary Tree from Preorder and Inorder Traversal ${\textsf{\color{yellow}Medium}}$ Solution
110. Balanced Binary Tree ${\textsf{\color{green}Easy}}$ Solution
115. Distinct Subsequences ${\textsf{\color{red}Hard}}$ Solution
121. Best Time to Buy and Sell Stock ${\textsf{\color{green}Easy}}$ Solution
124. Binary Tree Maximum Path Sum ${\textsf{\color{red}Hard}}$ Solution
125. Valid Palindrome ${\textsf{\color{green}Easy}}$ Solution
128-longest-consecutive-sequence ${\textsf{\color{yellow}Medium}}$ Solution
130. Surrounded Regions ${\textsf{\color{yellow}Medium}}$ Solution
131. Palindrome Partitioning ${\textsf{\color{yellow}Medium}}$ Solution
133. Clone Graph ${\textsf{\color{yellow}Medium}}$ Solution
134. Gas Station ${\textsf{\color{yellow}Medium}}$ Solution
136. Single Number ${\textsf{\color{green}Easy}}$ Solution
138. Copy List with Random Pointer ${\textsf{\color{yellow}Medium}}$ Solution
139. Word Break ${\textsf{\color{yellow}Medium}}$ Solution
141. Linked List Cycle ${\textsf{\color{green}Easy}}$ Solution
142. Linked List Cycle II ${\textsf{\color{yellow}Medium}}$ Solution
143. Reorder List ${\textsf{\color{yellow}Medium}}$ Solution
146. LRU Cache ${\textsf{\color{yellow}Medium}}$ Solution
150. Evaluate Reverse Polish Notation ${\textsf{\color{yellow}Medium}}$ Solution
152. Maximum Product Subarray ${\textsf{\color{yellow}Medium}}$ Solution
153. Find Minimum in Rotated Sorted Array ${\textsf{\color{yellow}Medium}}$ Solution
167. Two Sum II - Input Array Is Sorted ${\textsf{\color{yellow}Medium}}$ Solution
190. Reverse Bits ${\textsf{\color{green}Easy}}$ Solution
191. Number of 1 Bits ${\textsf{\color{green}Easy}}$ Solution
198. House Robber ${\textsf{\color{yellow}Medium}}$ Solution
199. Binary Tree Right Side View ${\textsf{\color{yellow}Medium}}$ Solution
200. Number of Islands ${\textsf{\color{yellow}Medium}}$ Solution
202. Happy Number ${\textsf{\color{green}Easy}}$ Solution
206. Reverse Linked List ${\textsf{\color{green}Easy}}$ Solution
207. Course Schedule ${\textsf{\color{yellow}Medium}}$ Solution
208. Implement Trie (Prefix Tree) ${\textsf{\color{yellow}Medium}}$ Solution
209. Minimum Size Subarray Sum ${\textsf{\color{yellow}Medium}}$ Solution
210. Course Schedule II ${\textsf{\color{yellow}Medium}}$ Solution
211. Design Add and Search Words Data Structure ${\textsf{\color{yellow}Medium}}$ Solution
215. Kth Largest Element in an Array ${\textsf{\color{yellow}Medium}}$ Solution
219. Contains Duplicate II ${\textsf{\color{green}Easy}}$ Solution
226. Invert Binary Tree ${\textsf{\color{green}Easy}}$ Solution
235. Lowest Common Ancestor of a Binary Search Tree ${\textsf{\color{yellow}Medium}}$ Solution
230. Kth Smallest Element in a BST ${\textsf{\color{yellow}Medium}}$ Solution
238. Product of Array Except Self ${\textsf{\color{yellow}Medium}}$ Solution
239. Sliding Window Maximum ${\textsf{\color{red}Hard}}$ Solution
242. Valid Anagram ${\textsf{\color{green}Easy}}$ Solution
261. Graph Valid Tree ${\textsf{\color{yellow}Medium}}$ Solution
268. Missing Number ${\textsf{\color{green}Easy}}$ Solution
269. Alien Dictionary ${\textsf{\color{red}Hard}}$ Solution
271. Encode and Decode Strings ${\textsf{\color{yellow}Medium}}$ Solution
283. Move Zeroes ${\textsf{\color{green}Easy}}$ Solution
287. Find the Duplicate Number ${\textsf{\color{yellow}Medium}}$ Solution
295. Find Median from Data Stream ${\textsf{\color{red}Hard}}$ Solution
300. Longest Increasing Subsequence ${\textsf{\color{yellow}Medium}}$ Solution
303. Range Sum Query - Immutable ${\textsf{\color{green}Easy}}$ Solution
312. Burst Balloons ${\textsf{\color{red}Hard}}$ Solution
322. Coin Change ${\textsf{\color{yellow}Medium}}$ Solution
323. Number of Connected Components In An Undirected Graph ${\textsf{\color{yellow}Medium}}$ Solution
338. Counting Bits ${\textsf{\color{green}Easy}}$ Solution
347. Top K Frequent Elements ${\textsf{\color{yellow}Medium}}$ Solution
416. Partition Equal Subset Sum ${\textsf{\color{yellow}Medium}}$ Solution
417. Pacific Atlantic Water Flow ${\textsf{\color{yellow}Medium}}$ Solution
424. Longest Repeating Character Replacement ${\textsf{\color{yellow}Medium}}$ Solution
450. Delete Node in a BST ${\textsf{\color{yellow}Medium}}$ Solution
494. Target Sum ${\textsf{\color{yellow}Medium}}$ Solution
496. Next Greater Element I ${\textsf{\color{green}Easy}}$ Solution
518. Coin Change II ${\textsf{\color{yellow}Medium}}$ Solution
543. Diameter of Binary Tree ${\textsf{\color{green}Easy}}$ Solution
560. Subarray Sum Equals K ${\textsf{\color{yellow}Medium}}$ Solution
567. Permutation in String ${\textsf{\color{yellow}Medium}}$ Solution
572. Subtree of Another Tree ${\textsf{\color{green}Easy}}$ Solution
647. Palindromic Substrings ${\textsf{\color{yellow}Medium}}$ Solution
684. Redundant Connection ${\textsf{\color{yellow}Medium}}$ Solution
695. Max Area of Island ${\textsf{\color{yellow}Medium}}$ Solution
701. Insert into a Binary Search Tree ${\textsf{\color{yellow}Medium}}$ Solution
703. Kth Largest Element in a Stream ${\textsf{\color{green}Easy}}$ Solution
724. Find Pivot Index ${\textsf{\color{green}Easy}}$ Solution
739. Daily Temperatures ${\textsf{\color{yellow}Medium}}$ Solution
743. Network Delay Time ${\textsf{\color{yellow}Medium}}$ Solution
763. Partition Labels ${\textsf{\color{yellow}Medium}}$ Solution
778. Swim in Rising Water ${\textsf{\color{red}Hard}}$ Solution
827. Making A Large Island ${\textsf{\color{red}Hard}}$ Solution
846. Hand of Straights ${\textsf{\color{yellow}Medium}}$ Solution
867. Transpose Matrix ${\textsf{\color{green}Easy}}$ Solution
875. Koko Eating Bananas ${\textsf{\color{yellow}Medium}}$ Solution
876. Middle of the Linked List ${\textsf{\color{green}Easy}}$ Solution
916. Word Subsets ${\textsf{\color{yellow}Medium}}$ Solution
973. K Closest Points to Origin ${\textsf{\color{yellow}Medium}}$ Solution
978. Longest Turbulent Subarray ${\textsf{\color{yellow}Medium}}$ Solution
994. Rotting Oranges ${\textsf{\color{yellow}Medium}}$ Solution
1004. Max Consecutive Ones III ${\textsf{\color{yellow}Medium}}$ Solution
1046. Last Stone Weight ${\textsf{\color{green}Easy}}$ Solution
1079. Letter Tile Possibilities ${\textsf{\color{yellow}Medium}}$ Solution
1092. Shortest Common Supersequence ${\textsf{\color{red}Hard}}$ Solution
1143. Longest Common Subsequence ${\textsf{\color{yellow}Medium}}$ Solution
1267. Count Servers that Communicate ${\textsf{\color{yellow}Medium}}$ Solution
1296. Divide Array in Sets of K Consecutive Numbers ${\textsf{\color{yellow}Medium}}$ Solution
1331. Rank Transform of an Array ${\textsf{\color{green}Easy}}$ Solution
1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold ${\textsf{\color{yellow}Medium}}$ Solution
1352. Product of the Last K Numbers ${\textsf{\color{yellow}Medium}}$ Solution
1400. Construct K Palindrome Strings ${\textsf{\color{yellow}Medium}}$ Solution
1415. The k-th Lexicographical String of All Happy Strings of Length n ${\textsf{\color{yellow}Medium}}$ Solution
1422. Maximum Score After Splitting a String ${\textsf{\color{green}Easy}}$ Solution
1448. Count Good Nodes in Binary Tree ${\textsf{\color{yellow}Medium}}$ Solution
1584. Min Cost to Connect All Points ${\textsf{\color{yellow}Medium}}$ Solution
1631. Path With Minimum Effort ${\textsf{\color{yellow}Medium}}$ Solution
1718. Construct the Lexicographically Largest Valid Sequence ${\textsf{\color{yellow}Medium}}$ Solution
1749. Maximum Absolute Sum of Any Subarray ${\textsf{\color{yellow}Medium}}$ Solution
1752. Check if Array Is Sorted and Rotated ${\textsf{\color{green}Easy}}$ Solution
1790. Check if One String Swap Can Make Strings Equal ${\textsf{\color{green}Easy}}$ Solution
1800. Maximum Ascending Subarray Sum ${\textsf{\color{green}Easy}}$ Solution
1930. Unique Length-3 Palindromic Subsequences ${\textsf{\color{yellow}Medium}}$ Solution
2013. Detect Squares ${\textsf{\color{yellow}Medium}}$ Solution
2130. Maximum Twin Sum of a Linked List ${\textsf{\color{yellow}Medium}}$ Solution
2161. Partition Array According to Given Pivot ${\textsf{\color{yellow}Medium}}$ Solution
2185. Counting Words With a Given Prefix ${\textsf{\color{green}Easy}}$ Solution
2270. Number of Ways to Split Array ${\textsf{\color{yellow}Medium}}$ Solution
2342. Max Sum of a Pair With Equal Sum of Digits ${\textsf{\color{yellow}Medium}}$ Solution
2364. Count Number of Bad Pairs ${\textsf{\color{yellow}Medium}}$ Solution
2375. Construct Smallest Number From DI String ${\textsf{\color{yellow}Medium}}$ Solution
2390. Removing Stars From a String ${\textsf{\color{yellow}Medium}}$ Solution
2460. Apply Operations to an Array ${\textsf{\color{green}Easy}}$ Solution
2559. Count Vowel Strings in Ranges ${\textsf{\color{yellow}Medium}}$ Solution
2570. Merge Two 2D Arrays by Summing Values ${\textsf{\color{green}Easy}}$ Solution
2658. Maximum Number of Fish in a Grid ${\textsf{\color{yellow}Medium}}$ Solution
2661. First Completely Painted Row or Column ${\textsf{\color{yellow}Medium}}$ Solution
2684. Maximum Number of Moves in a Grid ${\textsf{\color{yellow}Medium}}$ Solution
2698. Find the Punishment Number of an Integer ${\textsf{\color{yellow}Medium}}$ Solution
3066. Minimum Operations to Exceed Threshold Value II ${\textsf{\color{yellow}Medium}}$ Solution
3105. Longest Strictly Increasing or Strictly Decreasing Subarray ${\textsf{\color{green}Easy}}$ Solution
3151. Special Array I ${\textsf{\color{green}Easy}}$ Solution
3160. Find the Number of Distinct Colors Among the Balls ${\textsf{\color{yellow}Medium}}$ Solution
3174. Clear Digits ${\textsf{\color{green}Easy}}$ Solution
3223. Minimum Length of String After Operations ${\textsf{\color{yellow}Medium}}$ Solution

Releases

No releases published

Packages

No packages published