Skip to content

Emjumaev/DailyLeetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

263 Commits
 
 
 
 
 
 

Repository files navigation

DailyLeetcode

Daily LeetCode solutions in Swift.

Solutions

Total: 283 solutions

No. # Problem Name LeetCode Solution Language
1 1 Two Sum Link Solution Swift
2 3 Longest Substring Without Repeating Characters Link Solution Swift
3 7 Reverse Integer Link Solution Swift
4 9 Palindrome Number Link Solution Swift
5 11 Container With Most Water Link Solution Swift
6 13 Roman to Integer Link Solution Swift
7 14 Longest Common Prefix Link Solution Swift
8 15 3Sum Link Solution Swift
9 18 4Sum Link Solution Swift
10 19 Remove Nth Node From End of List Link Solution Swift
11 20 Valid Parentheses Link Solution Swift
12 21 Merge Two Sorted Lists Link Solution Swift
13 23 Merge k Sorted Lists Link Solution Swift
14 24 Swap Nodes in Pairs Link Solution Swift
15 26 Remove Duplicates from Sorted Array Link Solution Swift
16 27 Remove Element Link Solution Swift
17 33 Search in Rotated Sorted Array Link Solution Swift
18 35 Search Insert Position Link Solution Swift
19 39 Combination Sum Link Solution Swift
20 42 Trapping Rain Water Link Solution Swift
21 53 Maximum Subarray Link Solution Swift
22 54 Spiral Matrix Link Solution Swift
23 62 Unique Paths Link Solution Swift
24 63 Unique Paths II Link Solution Swift
25 66 Plus One Link Solution Swift
26 67 Add Binary Link Solution Swift
27 69 Sqrt(x) Link Solution Swift
28 70 Climbing Stairs Link Solution Swift
29 71 Simplify Path Link Solution Swift
30 73 Set Matrix Zeroes Link Solution Swift
31 74 Search a 2D Matrix Link Solution Swift
32 75 Sort Colors Link Solution Swift
33 78 Subsets Link Solution Swift
34 80 Remove Duplicates from Sorted Array II Link Solution Swift
35 83 Remove Duplicates from Sorted List Link Solution Swift
36 88 Merge Sorted Array Link Solution Swift
37 94 Binary Tree Inorder Traversal Link Solution Swift
38 98 Validate Binary Search Tree Link Solution Swift
39 100 Same Tree Link Solution Swift
40 102 Binary Tree Level Order Traversal Link Solution Swift
41 104 Maximum Depth of Binary Tree Link Solution Swift
42 105 Construct Binary Tree from Preorder and Inorder Traversal Link Solution Swift
43 112 Path Sum Link Solution Swift
44 121 Best Time to Buy and Sell Stock Link Solution Swift
45 125 Valid Palindrome Link Solution Swift
46 128 Longest Consecutive Sequence Link Solution Swift
47 133 Clone Graph Link Solution Swift
48 136 Single Number Link Solution Swift
49 143 Reorder List Link Solution Swift
50 144 Binary Tree Preorder Traversal Link Solution Swift
51 145 Binary Tree Postorder Traversal Link Solution Swift
52 150 Evaluate Reverse Polish Notation Link Solution Swift
53 153 Find Minimum in Rotated Sorted Array Link Solution Swift
54 155 Min Stack Link Solution Swift
55 160 Intersection of Two Linked Lists Link Solution Swift
56 167 Two Sum II - Input Array Is Sorted Link Solution Swift
57 168 Excel Sheet Column Title Link Solution Swift
58 169 Majority Element Link Solution Swift
59 171 Excel Sheet Column Number Link Solution Swift
60 173 Binary Search Tree Iterator Link Solution Swift
61 190 Reverse Bits Link Solution Swift
62 191 Number of 1 Bits Link Solution Swift
63 198 House Robber Link Solution Swift
64 200 Number of Islands Link Solution Swift
65 202 Happy Number Link Solution Swift
66 203 Remove Linked List Elements Link Solution Swift
67 205 Isomorphic Strings Link Solution Swift
68 206 Reverse Linked List Link Solution Swift
69 207 Course Schedule Link Solution Swift
70 215 Kth Largest Element in an Array Link Solution Swift
71 217 Contains Duplicate Link Solution Swift
72 219 Contains Duplicate II Link Solution Swift
73 225 Implement Stack using Queues Link Solution Swift
74 226 Invert Binary Tree Link Solution Swift
75 230 Kth Smallest Element in a BST Link Solution Swift
76 231 Power of Two Link Solution Swift
77 234 Palindrome Linked List Link Solution Swift
78 235 Lowest Common Ancestor of a Binary Search Tree Link Solution Swift
79 237 Delete Node in a Linked List Link Solution Swift
80 238 Product of Array Except Self Link Solution Swift
81 242 Valid Anagram Link Solution Swift
82 258 Add Digits Link Solution Swift
83 263 Ugly Number Link Solution Swift
84 268 Missing Number Link Solution Swift
85 278 First Bad Version Link Solution Swift
86 283 Move Zeroes Link Solution Swift
87 290 Word Pattern Link Solution Swift
88 326 Power of Three Link Solution Swift
89 338 Counting Bits Link Solution Swift
90 342 Power of Four Link Solution Swift
91 344 Reverse String Link Solution Swift
92 349 Intersection of Two Arrays Link Solution Swift
93 367 Valid Perfect Square Link Solution Swift
94 374 Guess Number Higher or Lower Link Solution Swift
95 383 Ransom Note Link Solution Swift
96 387 First Unique Character in a String Link Solution Swift
97 412 Fizz Buzz Link Solution Swift
98 414 Third Maximum Number Link Solution Swift
99 450 Delete Node in a BST Link Solution Swift
100 485 Max Consecutive Ones Link Solution Swift
101 492 Construct the Rectangle Link Solution Swift
102 496 Next Greater Element I Link Solution Swift
103 504 Base 7 Link Solution Swift
104 507 Perfect Number Link Solution Swift
105 509 Fibonacci Number Link Solution Swift
106 520 Detect Capital Link Solution Swift
107 557 Reverse Words in a String III Link Solution Swift
108 560 Subarray Sum Equals K Link Solution Swift
109 566 Reshape the Matrix Link Solution Swift
110 572 Subtree of Another Tree Link Solution Swift
111 589 N-ary Tree Preorder Traversal Link Solution Swift
112 654 Maximum Binary Tree Link Solution Swift
113 680 Valid Palindrome II Link Solution Swift
114 682 Baseball Game Link Solution Swift
115 695 Max Area of Island Link Solution Swift
116 700 Search in a Binary Search Tree Link Solution Swift
117 701 Insert into a Binary Search Tree Link Solution Swift
118 703 Kth Largest Element in a Stream Link Solution Swift
119 704 Binary Search Link Solution Swift
120 705 Design HashSet Link Solution Swift
121 707 Design Linked List Link Solution Swift
122 724 Find Pivot Index Link Solution Swift
123 728 Self Dividing Numbers Link Solution Swift
124 733 Flood Fill Link Solution Swift
125 735 Asteroid Collision Link Solution Swift
126 739 Daily Temperatures Link Solution Swift
127 762 Prime Number of Set Bits in Binary Representation Link Solution Swift
128 832 Flipping an Image Link Solution Swift
129 853 Car Fleet Link Solution Swift
130 875 Koko Eating Bananas Link Solution Swift
131 876 Middle of the Linked List Link Solution Swift
132 881 Boats to Save People Link Solution Swift
133 884 Uncommon Words from Two Sentences Link Solution Swift
134 897 Increasing Order Search Tree Link Solution Swift
135 901 Online Stock Span Link Solution Swift
136 912 Sort an Array Link Solution Swift
137 921 Minimum Add to Make Parentheses Valid Link Solution Swift
138 938 Range Sum of BST Link Solution Swift
139 942 DI String Match Link Solution Swift
140 946 Validate Stack Sequences Link Solution Swift
141 973 K Closest Points to Origin Link Solution Swift
142 976 Largest Perimeter Triangle Link Solution Swift
143 977 Squares of a Sorted Array Link Solution Swift
144 994 Rotting Oranges Link Solution Swift
145 1008 Construct Binary Search Tree from Preorder Traversal Link Solution Swift
146 1021 Remove Outermost Parentheses Link Solution Swift
147 1022 Sum of Root To Leaf Binary Numbers Link Solution Swift
148 1046 Last Stone Weight Link Solution Swift
149 1047 Remove All Adjacent Duplicates In String Link Solution Swift
150 1091 Shortest Path in Binary Matrix Link Solution Swift
151 1137 N-th Tribonacci Number Link Solution Swift
152 1143 Longest Common Subsequence Link Solution Swift
153 1190 Reverse Substrings Between Each Pair of Parentheses Link Solution Swift
154 1281 Subtract the Product and Sum of Digits of an Integer Link Solution Swift
155 1290 Convert Binary Number in a Linked List to Integer Link Solution Swift
156 1299 Replace Elements with Greatest Element on Right Side Link Solution Swift
157 1323 Maximum 69 Number Link Solution Swift
158 1342 Number of Steps to Reduce a Number to Zero Link Solution Swift
159 1343 Number of Sub-arrays of Size K and Average ≥ Threshold Link Solution Swift
160 1381 Design a Stack With Increment Operation Link Solution Swift
161 1394 Find Lucky Integer in an Array Link Solution Swift
162 1470 Shuffle the Array Link Solution Swift
163 1472 Design Browser History Link Solution Swift
164 1475 Final Prices With a Special Discount in a Shop Link Solution Swift
165 1480 Running Sum of 1d Array Link Solution Swift
166 1486 XOR Operation in an Array Link Solution Swift
167 1492 The kth Factor of n Link Solution Swift
168 1512 Number of Good Pairs Link Solution Swift
169 1523 Count Odd Numbers in an Interval Range Link Solution Swift
170 1544 Make The String Great Link Solution Swift
171 1598 Crawler Log Folder Link Solution Swift
172 1614 Maximum Nesting Depth of the Parentheses Link Solution Swift
173 1669 Merge In Between Linked Lists Link Solution Swift
174 1700 Number of Students Unable to Eat Lunch Link Solution Swift
175 1768 Merge Strings Alternately Link Solution Swift
176 1779 Find Nearest Point That Has the Same X or Y Coordinate Link Solution Swift
177 1812 Determine Color of a Chessboard Square Link Solution Swift
178 1822 Sign of the Product of an Array Link Solution Swift
179 1837 Sum of Digits in Base K Link Solution Swift
180 1861 Rotating the Box Link Solution Swift
181 1877 Minimize Maximum Pair Sum in Array Link Solution Swift
182 1910 Remove All Occurrences of a Substring Link Solution Swift
183 1920 Build Array from Permutation Link Solution Swift
184 1929 Concatenation of Array Link Solution Swift
185 1952 Three Divisors Link Solution Swift
186 1979 Find Greatest Common Divisor of Array Link Solution Swift
187 2000 Reverse Prefix of Word Link Solution Swift
188 2108 Find First Palindromic String in the Array Link Solution Swift
189 2119 A Number After a Double Reversal Link Solution Swift
190 2149 Rearrange Array Elements by Sign Link Solution Swift
191 2161 Partition Array According to Given Pivot Link Solution Swift
192 2181 Merge Nodes in Between Zeros Link Solution Swift
193 2236 Root Equals Sum of Children Link Solution Swift
194 2326 Spiral Matrix IV Link Solution Swift
195 2331 Evaluate Boolean Binary Tree Link Solution Swift
196 2367 Number of Arithmetic Triplets Link Solution Swift
197 2375 Construct Smallest Number From DI String Link Solution Swift
198 2390 Removing Stars From a String Link Solution Swift
199 2415 Reverse Odd Levels of Binary Tree Link Solution Swift
200 2442 Count Number of Distinct Integers After Reverse Operations Link Solution Swift
201 2469 Convert the Temperature Link Solution Swift
202 2487 Remove Nodes From Linked List Link Solution Swift
203 2570 Merge Two 2D Arrays by Summing Values Link Solution Swift
204 2652 Sum Multiples Link Solution Swift
205 2696 Minimum String Length After Removing Substrings Link Solution Swift
206 2697 Lexicographically Smallest Palindrome Link Solution Swift
207 2807 Insert Greatest Common Divisors in Linked List Link Solution Swift
208 2894 Divisible and Non-divisible Sums Difference Link Solution Swift
209 3174 Clear Digits Link Solution Swift
210 3191 Minimum Operations to Make Binary Array Elements Equal to One I Link Solution Swift
211 3194 Minimum Average of Smallest and Largest Elements Link Solution Swift
212 3507 Minimum Pair Removal to Sort Array I Link Solution Swift
213 3643 Flip Square Submatrix Vertically Link Solution Swift
214 3746 Minimum String Length After Balanced Removals Link Solution Swift
215 3794 Reverse String Prefix Link Solution Swift
216 3823 Reverse Letters Then Special Characters in a String Link Solution Swift
217 3884 First Matching Character From Both Ends Link Solution Swift
218 3783 Mirror Distance of an Integer Link Solution Swift
219 3512 Minimum Operations to Make Array Sum Divisible by K Link Solution Swift
220 2769 Find the Maximum Achievable Number Link Solution Swift
221 3190 Find Minimum Operations to Make All Elements Divisible by Three Link Solution Swift
222 1863 Sum of All Subset XOR Totals Link Solution Swift
223 3289 The Two Sneaky Numbers of Digitville Link Solution Swift
224 3300 Minimum Element After Replacement With Digit Sum Link Solution Swift
225 3516 Find Closest Person Link Solution Swift
226 3895 Count Digit Appearances Link Solution Swift
227 2125 Number of Laser Beams in a Bank Link Solution Swift
228 3264 Final Array State After K Multiplication Operations I Link Solution Swift
229 1688 Count of Matches in Tournament Link Solution Swift
230 2520 Count the Digits That Divide a Number Link Solution Swift
231 2535 Difference Between Element Sum and Digit Sum of an Array Link Solution Swift
232 3432 Count Partitions with Even Sum Difference Link Solution Swift
233 3658 GCD of Odd and Even Sums Link Solution Swift
234 394 Decode String Link Solution Swift
235 895 Maximum Frequency Stack Link Solution Swift
236 2485 Find the Pivot Integer Link Solution Swift
237 3099 Harshad Number Link Solution Swift
238 1780 Check if Number is a Sum of Powers of Three Link Solution Swift
239 1011 Capacity To Ship Packages Within D Days Link Solution Swift
240 92 Reverse Linked List II Link Solution Swift
241 138 Copy List with Random Pointer Link Solution Swift
242 2130 Maximum Twin Sum of a Linked List Link Solution Swift
243 141 Linked List Cycle Link Solution Swift
244 287 Find the Duplicate Number Link Solution Swift
245 2 Add Two Numbers Link Solution Swift
246 3217 Delete Nodes From Linked List Present in Array Link Solution Swift
247 2816 Double a Number Represented as a Linked List Link Solution Swift
248 622 Design Circular Queue Link Solution Swift
249 25 Reverse Nodes in k-Group Link Solution Swift
250 389 Find the Difference Link Solution Swift
251 1071 Greatest Common Divisor of Strings Link Solution Swift
252 867 Transpose Matrix Link Solution Swift
253 415 Add Strings Link Solution Swift
254 43 Multiply Strings Link Solution Swift
255 201 Bitwise AND of Numbers Range Link Solution Swift
256 1399 Count Largest Group Link Solution Swift
257 1980 Find Unique Binary String Link Solution Swift
258 2433 Find The Original Array of Prefix Xor Link Solution Swift
259 3760 Maximum Substrings With Distinct Start Link Solution Swift
260 3925 Concatenate Array With Reverse Link Solution Swift
261 1689 Partitioning Into Minimum Number Of Deci-Binary Numbers Link Solution Swift
262 3211 Generate Binary Strings Without Adjacent Zeros Link Solution Swift
263 2657 Find the Prefix Common Array of Two Arrays Link Solution Swift
264 2265 Count Nodes Equal to Average of Subtree Link Solution Swift
265 1302 Deepest Leaves Sum Link Solution Swift
266 3945 Digit Frequency Score Link Solution Swift
267 3668 Restore Finishing Order Link Solution Swift
268 918 Maximum Sum Circular Subarray Link Solution Swift
269 674 Longest Continuous Increasing Subsequence Link Solution Swift
270 978 Longest Turbulent Subarray Link Solution Swift
271 567 Permutation in String Link Solution Swift
272 303 Range Sum Query - Immutable Link Solution Swift
273 304 Range Sum Query 2D - Immutable Link Solution Swift
274 239 Sliding Window Maximum Link Solution Swift
275 229 Majority Element II Link Solution Swift
276 36 Valid Sudoku Link Solution Swift
277 50 Pow(x, n) Link Solution Swift
278 1325 Delete Leaves With a Given Value Link Solution Swift
279 1448 Count Good Nodes in Binary Tree Link Solution Swift
280 981 Time Based Key-Value Store Link Solution Swift
281 746 Min Cost Climbing Stairs Link Solution Swift
282 213 House Robber II Link Solution Swift
283 124 Binary Tree Maximum Path Sum Link Solution Swift
284 297 Serialize and Deserialize Binary Tree Link Solution Swift

About

My Leetcode solutions in Swift

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages