My attempt at tackling some of the most interesting coding challenges on leetcode!
Array Challenges
| Problem | Solution | Level | Tag |
|---|---|---|---|
| Duplicate Zeros | Python | Easy | |
| Missing Number | Python | Easy | |
| First Unique Character in a String | Python | Easy | |
| Intersection of 2 arrays | Python | Easy | Two Pointers |
| Squares of a sorted array | Python | Easy | |
| Sort Colors | Python | Medium | |
| Minimum Size Subarray Sum | Python | Medium | |
| Product of Array Except self | Python | Medium | |
| 3 Sum | Python | Medium | |
| 3 Sum Closest | Python | Medium | |
| Find first and last | Python | Medium | |
| Subsets | Python | Medium | |
| Interval list intersections | Python | Medium | Two Pointers |
| Max consecutive ones 3 | Python | Medium | Sliding Window |
| Continuous Subarray Sum | Java | Medium | |
| Product of the Last K Numbers | Java | Medium | |
| Subarray sum equals K | Python | Medium | |
| 3 Sum Smaller | Python | Medium | |
| Find the Celebrity | Python | Medium | |
| Summary Ranges | Python | Medium | |
| Grumpy bookstore owner | Python | Medium | Sliding Window |
| Maximum product subarray | Python | Medium | |
| Number of Submatrices That Sum to Target | Python | Hard | Sliding Window |
| First Missing Positive | Python | Hard | |
| Sliding window maximum | Python | Hard | Sliding Window |
Binary Search
| Problem | Solution | Level |
|---|---|---|
| First Bad Version | Python | Easy |
| Search in Rotated Sorted Array | Python | Medium |
| Find Peak Element | Python | Medium |
| Find Minimum in Rotated Sorted Array | Python | Medium |
| Search Range | Python | Medium |
Linked List Challenges
| Problem | Solution | Level |
|---|---|---|
| Merge two sorted lists | Python | Medium |
| Copy list with random pointer | Python | Medium |
| Sort list | Python | Medium |
| Remove Nth Node | Python | Medium |
| Merge K sorted lists | Python | Hard |
String Challenges
| Problem | Solution | Level |
|---|---|---|
| Reorder log files | Python | Easy |
| Valid Parantheses | Python | Easy |
| Group Anagrams | Python | Medium |
| Compare Version Numbers | Python | Medium |
| Longest Palindromic Substring | Python | Medium |
| Generate Parantheses | Python | Medium |
| Decode Ways | Python | Medium |
| Minimum Time Difference | Python | Medium |
| Camelcase Matching | Python | Medium |
| Search suggestions | Python | Medium |
| Longest Valid Parentheses | Python | Hard |
Stacks and Queues Challenges
| Problem | Solution | Level |
|---|---|---|
| Min stack | Python | Easy |
Tree Challenges
| Problem | Solution | Level |
|---|---|---|
| Subtree of another tree | Python | Easy |
| Two Sum IV | Python | Easy |
| Diameter of a binary tree | Python | Easy |
| Kth Smallest | Python | Medium |
| Find Leaves of a binary tree | Python | Medium |
| Binary Tree Pruning | Python | Medium |
Heap Challenges
| Problem | Solution | Level |
|---|---|---|
| Kth largest element in a stream | Python | Easy |
| High Five | Python | Easy |
| Kth smallest Element | Python | Medium |
| Top K frequent elements | Python | Medium |
| Employee Free Time | Python | Hard |
Graph Challenges
| Problem | Solution | Level |
|---|---|---|
| Find the Town Judge | Python | Easy |
| Valid Tree | Python | Medium |
| Can visit all rooms | Python | Medium |
| Path with maximum minimum value | Python | Medium |
| Redundant Connections | Python | Medium |
| Number of Connected Components | Python | Medium |
| Course Schedule 2 | Python | Medium |
Greedy challenges
| Problem | Solution | Level |
|---|---|---|
| Last Stone Weight | Python | Easy |
| Lemonade Change | Python | Easy |
| Two City Scheduling | Python | Easy |
| Is Subsequence | Python | Easy |
| Shortest way | Python | Medium |
| Minimum arrows | Python | Medium |
| String without AAA or BBB | Python | Medium |
| Minimum Dominoes | Python | Medium |
| Minimum Cost to Connect Sticks | Python | Medium |
Divide and Conquer Challenges
| Problem | Solution | Level |
|---|---|---|
| Maximum Subarray sum | Python | Easy |
| Longest Common Prefix | Python | Easy |
Backtracking
| Problem | Solution | Level |
|---|---|---|
| Combination Sum | Python | Medium |
| Path with max gold | Python | Medium |
| Palindrome Partitioning | Python | Medium |
| Word Search | Python | Medium |
Dynamic Programming
| Problem | Solution | Level |
|---|---|---|
| Longest word in dictionary | Python | Easy |
| Longest Common Subsequence | Python | Medium |
| Minimum path sum | Python | Medium |
| Unique Paths | Python | Medium |
| Perfect Squares | Python | Medium |
| Number of Dice Rolls | Python | Medium |
| Target Sum | Python | Medium |
| Longest String Chain | Python | Medium |
| Maximum Length of Repeated Subarray | Python | Medium |
| Integer Break | Python | Medium |
| Word Break | Python | Medium |
| Number of distinct islands | Python | Medium |
| Longest Increasing Path in a Matrix | Python | Hard |
Depth First Search
| Problem | Solution | Level |
|---|---|---|
| Is Same Tree | Python | Easy |
| Validate BST | Python | Medium |
| Friend Circles | Python | Medium |
| Max Area of Island | Python | Medium |
| Path Sum II | Python | Medium |
| Unique Paths III | Python | Hard |
| Concatenated Words | Python | Hard |
| Longest Consecutive Sequence | Python | Hard |
Breadth First Search
| Problem | Solution | Level |
|---|---|---|
| 01 Matrix | Python | Medium |
| Binary tree right side view | Python | Medium |
| Sliding Puzzle | Python | Hard |