Skip to content

AhmedNasserG/My-LeetCode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Leetcode

# Title Solution Runtime
1 Two Sum Java 3 ms
2 Add Two Numbers Java 3 ms
3 Longest Substring Without Repeating Characters C++ 16 ms
4 Median of Two Sorted Arrays Java 4 ms
5 Longest Palindromic Substring Java 10 ms
9 Palindrome Number Java 6 ms
10 Regular Expression Matching Java 2 ms
11 Container With Most Water Java 9 ms
13 Roman to Integer Java 13 ms
15 3Sum Java 25 ms
16 3Sum Closest Java 137 ms
17 Letter Combinations of a Phone Number Java 4 ms
19 Remove Nth Node From End of List Java 0 ms
20 Valid Parentheses Java 1 ms
21 Merge Two Sorted Lists Java 0 ms
22 Generate Parentheses Java 1 ms
23 Merge k Sorted Lists Java 2 ms
24 Swap Nodes in Pairs Java 0 ms
29 Divide Two Integers Java 1 ms
31 Next Permutation Java 1 ms
33 Search in Rotated Sorted Array Java 1 ms
34 Find First and Last Position of Element in Sorted Array Java 0 ms
36 Valid Sudoku Java 28 ms
38 Count and Say Java 4 ms
40 Combination Sum II Java 5 ms
41 First Missing Positive Java 3 ms
42 Trapping Rain Water Java 1 ms
44 Wildcard Matching Java 59 ms
45 Jump Game II Java 3 ms
47 Permutations II Java 3 ms
48 Rotate Image Java 0 ms
50 Pow(x, n) Java 0 ms
53 Maximum Subarray Java 2 ms
54 Spiral Matrix Java 0 ms
55 Jump Game Java 4 ms
56 Merge Intervals Java 8 ms
58 Length of Last Word Java 0 ms
61 Rotate List Java 1 ms
62 Unique Paths Java 0 ms
64 Minimum Path Sum Java 2 ms
65 Valid Number Java 5 ms
67 Add Binary Java 4 ms
68 Text Justification Java 1 ms
70 Climbing Stairs Java 0 ms
71 Simplify Path Java 6 ms
72 Edit Distance Java 7 ms
74 Search a 2D Matrix Java 1 ms
76 Minimum Window Substring Java 11 ms
78 Subsets Java 0 ms
79 Word Search Java 258 ms
82 Remove Duplicates from Sorted List II Java 1 ms
91 Decode Ways Java 1 ms
98 Validate Binary Search Tree Java 1 ms
99 Recover Binary Search Tree Java 2 ms
103 Binary Tree Zigzag Level Order Traversal Java 1 ms
109 Convert Sorted List to Binary Search Tree Java 0 ms
113 Path Sum II Java 3 ms
115 Distinct Subsequences Java 22 ms
116 Populating Next Right Pointers in Each Node Java 1 ms
121 Best Time to Buy and Sell Stock Java 6 ms
122 Best Time to Buy and Sell Stock II Java 5 ms
124 Binary Tree Maximum Path Sum Java 1 ms
127 Word Ladder Java 73 ms
130 Surrounded Regions Java 1 ms
133 Clone Graph Java 34 ms
134 Gas Station Java 2 ms
138 Copy List with Random Pointer Java 0 ms
139 Word Break Java 5 ms
140 Word Break II Java 0 ms
141 Linked List Cycle Java 0 ms
146 LRU Cache Java 90 ms
148 Sort List Java 9 ms
153 Find Minimum in Rotated Sorted Array Java 0 ms
155 Min Stack Java 10 ms
162 Find Peak Element Java 0 ms
165 Compare Version Numbers Java 2 ms
169 Majority Element Java 2 ms
171 Excel Sheet Column Number Java 1 ms
191 Number of 1 Bits Java 0 ms
199 Binary Tree Right Side View Java 1 ms
200 Number of Islands Java 7 ms
206 Reverse Linked List Java 0 ms
207 Course Schedule Java 2 ms
209 Minimum Size Subarray Sum Java 2 ms
210 Course Schedule II Java 8 ms
211 Design Add and Search Words Data Structure Java 35 ms
212 Word Search II Java 255 ms
215 Kth Largest Element in an Array Java 6 ms
224 Basic Calculator Java 3 ms
227 Basic Calculator II Java 120 ms
228 Summary Ranges Java 9 ms
230 Kth Smallest Element in a BST Java 0 ms
235 Lowest Common Ancestor of a Binary Search Tree Java 9 ms
236 Lowest Common Ancestor of a Binary Tree Java 7 ms
238 Product of Array Except Self Java 1 ms
239 Sliding Window Maximum Java 69 ms
257 Binary Tree Paths Java 2 ms
273 Integer to English Words Java 8 ms
278 First Bad Version Java 12 ms
284 Peeking Iterator Java 4 ms
289 Game of Life Java 1 ms
295 Find Median from Data Stream Java 106 ms
297 Serialize and Deserialize Binary Tree Java 45 ms
315 Count of Smaller Numbers After Self Java 306 ms
322 Coin Change Java 21 ms
329 Longest Increasing Path in a Matrix Java 15 ms
338 Counting Bits Java 3 ms
367 Valid Perfect Square Java 0 ms
378 Kth Smallest Element in a Sorted Matrix Java 37 ms
380 Insert Delete GetRandom O(1) Java N/A
387 First Unique Character in a String Java 17 ms
392 Is Subsequence Java 1 ms
394 Decode String Java 0 ms
398 Random Pick Index Java 112 ms
402 Remove K Digits Java 18 ms
413 Arithmetic Slices Java 0 ms
415 Add Strings Java 2 ms
416 Partition Equal Subset Sum Java 128 ms
417 Pacific Atlantic Water Flow Java 9 ms
430 Flatten a Multilevel Doubly Linked List Java 0 ms
435 Non-overlapping Intervals Java 118 ms
437 Path Sum III Java 2 ms
460 LFU Cache Java 63 ms
486 Predict the Winner Java 1 ms
498 Diagonal Traverse Java 2 ms
503 Next Greater Element II Java 34 ms
513 Find Bottom Left Tree Value Java 0 ms
515 Find Largest Value in Each Tree Row Java 1 ms
523 Continuous Subarray Sum Java 15 ms
528 Random Pick with Weight Java 34 ms
540 Single Element in a Sorted Array Java 0 ms
543 Diameter of Binary Tree Java 0 ms
547 Number of Provinces Java 2 ms
556 Next Greater Element III Java 6 ms
560 Subarray Sum Equals K Java 52 ms
630 Course Schedule III Java 47 ms
658 Find K Closest Elements Java 3 ms
662 Maximum Width of Binary Tree Java 2 ms
670 Maximum Swap Java 0 ms
674 Longest Continuous Increasing Subsequence Java 1 ms
676 Implement Magic Dictionary Java 45 ms
692 Top K Frequent Words Java 9 ms
695 Max Area of Island Java 5 ms
698 Partition to K Equal Sum Subsets Java 1779 ms
719 Find K-th Smallest Pair Distance Java 10 ms
733 Flood Fill Java 1 ms
735 Asteroid Collision Java 12 ms
740 Delete and Earn Java 7 ms
767 Reorganize String Java 1 ms
785 Is Graph Bipartite? Java 0 ms
799 Champagne Tower Java 5 ms
818 Race Car Java 78 ms
827 Making A Large Island Java 108 ms
829 Consecutive Numbers Sum Java 10 ms
841 Keys and Rooms Java 0 ms
856 Score of Parentheses Java 0 ms
863 All Nodes Distance K in Binary Tree Java
876 Middle of the Linked List Java 0 ms
909 Snakes and Ladders Java 9 ms
921 Minimum Add to Make Parentheses Valid Java 0 ms
937 Reorder Data in Log Files Java 47 ms
939 Minimum Area Rectangle Java 624 ms
946 Validate Stack Sequences Java 0 ms
953 Verifying an Alien Dictionary Java 0 ms
973 K Closest Points to Origin Java 47 ms
977 Squares of a Sorted Array Java 2 ms
981 Time Based Key-Value Store Java 426 ms
986 Interval List Intersections Java 2 ms
987 Vertical Order Traversal of a Binary Tree Java 3 ms
988 Smallest String Starting From Leaf Java 10 ms
994 Rotting Oranges Java 5 ms
1004 Max Consecutive Ones III Java 3 ms
1009 Complement of Base 10 Integer Java 0 ms
1011 Capacity To Ship Packages Within D Days Java 13 ms
1013 Partition Array Into Three Parts With Equal Sum Java 4 ms
1015 Smallest Integer Divisible by K Java 3 ms
1020 Number of Enclaves Java 4 ms
1029 Two City Scheduling Java 2 ms
1041 Robot Bounded In Circle Java 1 ms
1047 Remove All Adjacent Duplicates In String Java 9 ms
1162 As Far from Land as Possible Java 24 ms
1192 Critical Connections in a Network Java 103 ms
1209 Remove All Adjacent Duplicates in String II Java 17 ms
1235 Maximum Profit in Job Scheduling Java 74 ms
1239 Maximum Length of a Concatenated String with Unique Characters Java 7 ms
1249 Minimum Remove to Make Valid Parentheses Java 27 ms
1254 Number of Closed Islands Java 2 ms
1268 Search Suggestions System Java 80 ms
1288 Remove Covered Intervals Java 6 ms
1304 Find N Unique Integers Sum up to Zero Java 0 ms
1306 Jump Game III Java
1331 Rank Transform of an Array Java 72 ms
1335 Minimum Difficulty of a Job Schedule Java 110 ms
1345 Jump Game IV Java 60 ms
1349 Maximum Students Taking Exam Java 100 ms
1353 Maximum Number of Events That Can Be Attended Java 155 ms
1359 Count All Valid Pickup and Delivery Options Java 0 ms
1373 Maximum Sum BST in Binary Tree Java 13 ms
1376 Time Needed to Inform All Employees Java 139 ms
1387 Sort Integers by The Power Value Java 52 ms
1396 Design Underground System Java 157 ms
1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts Java 28 ms
1472 Design Browser History Java 145 ms
1481 Least Number of Unique Integers after K Removals Java 144 ms
1519 Number of Nodes in the Sub-Tree With the Same Label Java 137 ms
1603 Design Parking System Java 10 ms
1614 Maximum Nesting Depth of the Parentheses Java 0 ms
1629 Slowest Key Java 2 ms
1647 Minimum Deletions to Make Character Frequencies Unique Java 12 ms
1648 Sell Diminishing-Valued Colored Balls Java 126 ms
1675 Minimize Deviation in Array Java 132 ms
1710 Maximum Units on a Truck Java 9 ms
1761 Minimum Degree of a Connected Trio in a Graph Java 34 ms
1770 Maximum Score from Performing Multiplication Operations Java 702 ms
1792 Maximum Average Pass Ratio Java 953 ms
1799 Maximize Score After N Operations Java 357 ms
1871 Jump Game VII Java
1905 Count Sub Islands Java 44 ms
1928 Minimum Cost to Reach Destination in Time Java 70 ms
1963 Minimum Number of Swaps to Make the String Balanced Java 14 ms
2160 Minimum Sum of Four Digit Number After Splitting Digits Java 2 ms
2172 Maximum AND Sum of Array Java 371 ms
2177 Find Three Consecutive Integers That Sum to a Given Number Java 2 ms
2178 Maximum Split of Positive Even Integers Java 11 ms
2409 Count Days Spent Together Java 9 ms
2410 Maximum Matching of Players With Trainers Java 32 ms
2411 Smallest Subarrays With Maximum Bitwise OR Java 111 ms
2416 Sum of Prefix Scores of Strings Java 217 ms
2421 Number of Good Paths Java 168 ms

About

My accepted solutions to LeetCode problems

Topics

Resources

Stars

Watchers

Forks

Languages