/leetcode-150

leetcode's top 150 questions for interviews preparation

Primary LanguagePython

LeetCode 150

LeetCode's 150 questions for interviews preparation

1. Merge sorted arrays | Solution
2. Remove Element | Solution
3. Remove duplicates from a sorted array | Brute force solution | Optimized solution
4. Remove duplicates from sorted array II (medium) | My bruteforce solution
5. Majority element | Solution
6. Rotate array | Solution
7. Best time to buy and sell stock I | Solution
8. Best time to buy and sell stocks II | Solution
9. Jump game | Solution
10. Jump game II | Solution
11. h-index | Solution
12. Insert Delete GetRandom O(1) | Solution
13. Gas station * | My naive solution(doesn't work well for very large inputs) | Optimize solution
14. Candy | Solution
15. Trapping rain water | Solution
16. Roman to integer | Solution
17. Length of the last word | Solution
18. Integer to roman | Solution
19. Longest common prefix | Solution
20. Reverse words in a string | Solution
21. Find the index of the first occurence in a string | Solution
22. Zigzag conversion | Solution
23. Text justification | Solution
24. Valid palindrome | Solution
25. Is subsequence | Solution
26. Two sum II - Input array is sorted | Solution
27. Container with most water | Solution
28. 3Sum | Solution
29. Minimum Size Subarray Sum | My naive solution which doesn't work well on big inputs | Optimized Solution
30. Longest Substring without repeating characters | Solution
31. Ransom Note | Solution
32. Isomorphic Strings | Solution
33. Word Pattern | Solution
34. Valid Anagram | Solution
35. Group Anagrams | Solution
36. Two Sum | Solution
37. Longest Consecutive Sequence | Solution
38. Happy Number | Solution
39. Contains Duplicates II | Solution
40. Rotate Image | Solution
41. Spiral matrix | Solution
42. Set Matrix Zeroes | Solution
43. Valid Sudoku | Solution
44. Summary Ranges | Solution
45. Merge Intervals | Solution
46. Insert Interval | Solution
47. Minimum Number Of Arrows To Burst Balloons | Solution
48. Valid Parenthesis | Solution
49 Min Stack | Solution
50. Evaluate Reverse Polish Notation | Solution
51. Basic Calculator | Solution
52. Linked List Cycle | Runner vs Walker Algorithm (Floyd's Hare vs Tortoise Algorithm) Solution | Bruteforce Solution
53. Add Two Numbers | Solution
54. Merge Two Sorted Lists | Solution
55. Copy List With a Random Pointer | Solution
56. Remove nth node from the end of the list | Solution
56. Maximum Depth of a Binary Tree | Solution