Skip to content

Leetcode solutions in C++, C#, Python, Java, Scala, JS, Kotlin, Go, etc

Notifications You must be signed in to change notification settings

AlgoStudyGroup/Leetcode

Repository files navigation

LeetCode

https://leetcode.com

November LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Convert Binary Number in a Linked List to Integer
  2. Insertion Sort List
  3. Consecutive Characters
  4. Minimum Height Trees
  5. Minimum Cost to Move Chips to The Same Position
  6. Find the Smallest Divisor Given a Threshold
  7. Add Two Numbers II
  8. Binary Tree Tilt
  9. Maximum Difference Between Node and Ancestor
  10. Flipping an Image
  11. Valid Square
  12. Permutations II
  13. Populating Next Right Pointers in Each Node
  14. Poor Pigs
  15. Range Sum of BST
  16. Longest Mountain in Array
  17. Mirror Reflection
  18. Merge Intervals
  19. Decode String
  20. Search in Rotated Sorted Array II
  21. Numbers At Most N Given Digit Set
  22. Unique Morse Code Words

October LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Number of Recent Calls : Queue
  2. Combination Sum
  3. K-diff Pairs in an Array
  4. Remove Covered Intervals
  5. Complement of Base 10 Integer
  6. Insert into a Binary Search Tree
  7. Rotate List
  8. Binary Search
  9. Serialize and Deserialize BST
  10. Minimum Number of Arrows to Burst Balloons
  11. Remove Duplicate Letters
  12. Buddy Strings
  13. Sort List
  14. House Robber II
  15. Rotate Array
  16. Search a 2D Matrix
  17. Repeated DNA Sequences
  18. Best Time to Buy and Sell Stock IV
  19. Minimum Domino Rotations For Equal Row
  20. Clone Graph
  21. Asteroid Collision
  22. Minimum Depth of Binary Tree
  23. 132 Pattern
  24. Bag of Tokens
  25. Stone Game IV
  26. Champagne Tower
  27. Linked List Cycle II
  28. Summary Ranges
  29. Maximum Distance to Closest Person
  30. Number of Longest Increasing Subsequence
  31. Recover Binary Search Tree

September LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Largest Time for Given Digits
  2. Contains Duplicate III
  3. Repeated Substring Pattern
  4. Partition Labels
  5. All Elements in Two Binary Search Trees
  6. Image Overlap
  7. Word Pattern
  8. Sum of Root To Leaf Binary Numbers
  9. Compare Version Numbers
  10. Bulls and Cows
  11. Maximum Product Subarray
  12. Combination Sum III
  13. Insert Interval
  14. House Robber
  15. Length of Last Word
  16. Maximum XOR of Two Numbers in an Array
  17. Robot Bounded In Circle
  18. Best Time to Buy and Sell Stock
  19. Sequential Digits
  20. Gas Station
  21. Subarray Product Less Than K
  22. First Missing Positive

August LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Detect Capital
  2. Design HashSet
  3. Valid Palindrome
  4. Power of Four
  5. Add and Search Word Data structure design
  6. Find All Duplicates in an Array
  7. Vertical Order Traversal of a Binary Tree
  8. Path Sum III
  9. Rotting Oranges
  10. Excel Sheet Column Number
  11. H-Index
  12. Pascal's Triangle II
  13. Iterator for Combination
  14. Longest Palindrome
  15. Non-overlapping Intervals
  16. Best Time to Buy and Sell Stock III
  17. Distribute Candies to People
  18. Numbers With Same Consecutive Differences
  19. Goat Latin
  20. Reorder List
  21. Sort Array By Parity
  22. Random Point in Non-overlapping Rectangles
  23. Stream of Characters
  24. Sum of Left Leaves
  25. Minimum Cost For Tickets
  26. Fizz Buzz
  27. Find Right Interval
  28. Implement Rand10() Using Rand7()
  29. Pancake Sorting
  30. Largest Component Size by Common Factor
  31. Delete Node in a BST

July LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Arranging Coins: Maths
  2. Binary Tree Level Order Traversal II: DFS
  3. Prison Cells After N Days: Maths
  4. Ugly Number II: DP
  5. Hamming Distance: Bitwise Manipulation
  6. Plus One: Maths
  7. Island Perimeter: BFS
  8. 3Sum: Two pointers
  9. Maximum Width of Binary Tree: DFS
  10. Flatten a Multilevel Doubly Linked List: Queue
  11. Subsets: DP
  12. Reverse Bits: Bitwise
  13. Same Tree: DFS
  14. Angle Between Hands of a Clock: Math
  15. Reverse Words in a String: Pointer
  16. Pow(x,n): Recursion
  17. Top K Frequent Elements: Bucket
  18. Course Schedule II: BFS
  19. Add Binary
  20. Remove Linked List Elements
  21. Word Search
  22. Binary Tree Zigzag Level Order Traversal
  23. Single Number III
  24. All Paths From Source to Target
  25. Find Minimum in Rotated Sorted Array II
  26. Add Digits
  27. Construct Binary Tree from Inorder and Postorder Traversal
  28. Task Scheduler
  29. Best Time to Buy and Sell Stock with Cooldown: State machine
  30. Word Break II
  31. Climbing Stairs: DP

June LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. Invert Binary Tree: Tree Traversal
  2. Delete Node in a Linked List: Linked List
  3. Two City Scheduling: DP
  4. Reverse String: String
  5. Random Pick With Weight: Binary Search + Probability
  6. Queue Reconstruction by Height: Greedy
  7. Coin Change 2: DP
  8. Power of Two: Bitwise manipulation
  9. Is Subsequence: Two pointers / DP
  10. Search Insert Position: Binary Search
  11. Sort Colors: Two Pointers
  12. Insert Delete GetRandom: Hash Table
  13. Largest Divisible Subset: DP
  14. Cheapest Flights Within K Stops: DP
  15. Search in a Binary Search Tree: Recursive
  16. Validate IP Address: String
  17. Surrounded Regions: BFS
  18. H Index II: Binary Search
  19. Longest Duplicate Substring:
  20. Permutation Sequence: Maths
  21. Dungeon Game: DP
  22. Single Number II: Bitwise Manipulation
  23. Count Complete Tree Nodes: Tree Traversal
  24. Unique Binary Search Trees: DP
  25. Find the Duplicate Number: Cycle Detect
  26. Sum Root To Leaf Numbers: DFS
  27. Perfect Squares: DP
  28. Reconstruct Itinerary: DFS
  29. Unique Paths: DP
  30. Word Search: Trie + DFS

May LeetCoding Challenge

Click here for problem descriptions.

Solutions in various programming languages are provided. Enjoy it.

  1. First Bad String: Binary search.
  2. Jewels and Stones: Hash Table
  3. Ransom Note: Hash Table
  4. Number Complement: Bitwise Manipulation
  5. First Unique Character In a String: Hash Table
  6. Majority Element: Ad hoc
  7. Cousins in Binary Tree: BFS / Recursion
  8. Check if it is straight line: Cross Product
  9. Valid Perfect Square: Math
  10. Find the Town Judge: Graph Theory
  11. Flood Fill: BFS
  12. Single Element In a Sorted Array: Binary Search
  13. Remove K Digits: Greedy
  14. Implement Trie: Trie
  15. Maximum Sum Circular Subarray: DP
  16. Odd Even Linked List: Linked List
  17. Find All Anagrams in a String: Sliding window + Hash Table
  18. Permutation In String: Sliding window + Hash Table
  19. Online Stock Span: DP
  20. Kth-Smallest-Element-In-A-BST: BST
  21. Count Square Submatrices with All Ones: DP
  22. Sort Characters By Frequency: Hash Table
  23. Interval List Intersections: Two Pointers
  24. Construct Binary Search Tree from Preorder Traversal: Binary Search Tree
  25. Uncrossed Lines: DP
  26. Contiguous Array: Hash Table
  27. Possible Bipartition: Bipartite Graph
  28. Counting Bits: Math
  29. Course Schedule: Topological Sort
  30. K Closest Points to Origin: Priority_queue, Sort
  31. Edit Distance: DP

30-Day (April) LeetCoding Challenge

Click here for problem descriptions.

  1. Single Number: Bitwise Manipulation
  2. Happy Number: Implementation
  3. Maximum Subarray: DP
  4. Move Zeros: Two pointers
  5. Best Time to Buy and Sell Stock II: Greedy
  6. Group Anagrams: Hash Table