This repository contains solutions to various algorithm problems implemented in Python. Each solution is structured as a standalone script that solves a specific problem.
- Best Time to Buy and Sell Stock
- Check Inclusion
- Container With Most Water
- Find Duplicate
- Find Median from Data Stream
- Find Median Sorted Arrays
- Length of the Longest Substring
- Longest Consecutive Sequence
- Minimum Window Substring
- Product Except Self
- Sliding Window Maximum
- Three Sum
- Trapping Rain Water
- Valid Palindrome
- Binary Tree Right Side View
- Good Nodes
- Lowest Common Ancestor in BST
- Max Path Sum
- Serialize and Deserialize Binary Tree
- Copy Linked List with Random Pointer
- Has Cycle
- Merge K Sorted Lists
- Merge Two Sorted Lists
- Remove Nth Node From End
- Reverse K Group
- Climbing Stairs
- Coin Change
- Combination Sum
- House Robber
- House Robber II
- Max Product Subarray
- Min Cost Climbing Stairs
- Word Break
- Encode and Decode Strings
- Kth Largest Element in a Stream
- Max Area of Islands
- Search in 2D Matrix
- Subsets
- Word Search
- Word Search II
Each Python file contains a standalone implementation of a problem solution. To run a specific problem, execute:
python code-solutions/filename.pyExample:
python code-solutions/best_time_to_buy_sell_stock.pyFeel free to open issues or create pull requests if you find improvements or additional solutions to be added.