Solutions for all the leetcode questions I solved.
Runtime and memory usage is mentioned at the top of each program.
# | Title | Difficulty |
---|---|---|
1 | Two Sum | Easy |
7 | Reverse Integer | Medium |
9 | Palindrome Number | Easy |
26 | Remove Duplicate from Sorted Array | Easy |
27 | Remove Element | Easy |
28 | Find the Index of the First Occurrence in a String | Easy |
29 | Divide Two Integers | Medium |
58 | Length of last word | Easy |
61 | Rotate List | Medium |
66 | Plus One | Easy |
69 | Sqrt(x) | Easy |
74 | Search a 2D Matrix | Medium |
83 | Remove duplicates from sorted list | Easy |
121 | Best Time to Buy and Sell Stock | Easy |
125 | Valid palindrome | Easy |
160 | Intersection of Two Linked Lists | Easy |
191 | Number of 1 Bits | Easy |
242 | Valid Anagram | Easy |
258 | Add Digits | Easy |
263 | Ugly Number | Easy |
268 | Missing Number | Easy |
344 | Reverse String | Easy |
367 | Valid Perfect Square | Easy |
441 | Arranging Coins | Easy |
704 | Binary Search | Easy |
977 | Squares of Sorted Array | Easy |
2235 | Add Two Integers | Easy |
2938 | Separate Black and White Balls | Medium |