Skip to content
Leetcode solutions in C++, C#, Python, Java, Scala, JS, Kotlin, Go, etc
Kotlin C++ Java Scala Python JavaScript Other
Branch: master
Clone or download

README.md

LeetCode

https://leetcode.com

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

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
You can’t perform that action at this time.