This repository is created by a clumsy programmer who always struggles with coding problems on LeetCode, even with some Easy questions.
How on earth can I ever think of a solution like that in an interview?!
I'm working on implementing common Algorithms and Data Structures in Python (with test cases, of course), as well as straightforward solutions to some problems from LeetCode, HackerRank, and HackerEarth which I solved with frustration in mind.
Well, there are SO MUCH things to learn in Computer Science. I'm just a peasant who happens to write some crappy code for living.
This project requires Python 3.6 or higher.
A list of companies (or teams) that don't do "whiteboard" interviews.
- Discussing a real world problem (with or without whiteboard) is 👍
- Solving CS trivia, technical puzzles, riddles, brainteasers (with or without whiteboard) is 👎
algorithms/
data_structures/
arrays/
b_trees/
graphs/
hash_maps/
heaps/
linked_lists/
queues/
sets/
stacks/
trees/
problems/
- Array
- Array Sum on HackerEarth
- Find Minimum in Rotated Sorted Array on LeetCode
- Maximum Product Subarray on LeetCode
- Maximum Subarray on LeetCode
- Merge Intervals on LeetCode
- Missing Number on LeetCode
- Product of Array Except Self on LeetCode
- Search in Rotated Sorted Array on LeetCode
- Shuffle the Array on LeetCode
- Subsets on LeetCode
- Two Sum II - Input array is sorted on LeetCode
- Linked List
- String
- HashMap
- Set
- Multiset
- Heap
- Stack
- Binary Tree
- Balanced Binary Tree on LeetCode
- Binary Search Tree Iterator on LeetCode
- Binary Tree Inorder Traversal on LeetCode
- Binary Tree Level Order Traversal on LeetCode
- Binary Tree Maximum Path Sum on LeetCode
- Binary Tree Postorder Traversal on LeetCode
- Binary Tree Preorder Traversal on LeetCode
- Check Completeness of a Binary Tree on LeetCode
- Find Mode in Binary Search Tree on LeetCode
- Invert Binary Tree on LeetCode
- Kth Smallest Element in a BST on LeetCode
- Maximum Depth of Binary Tree on LeetCode
- Minimum Depth of Binary Tree on LeetCode
- Path Sum on LeetCode
- Same Tree on LeetCode
- Search in a Binary Search Tree on LeetCode
- Serialize and Deserialize Binary Tree on LeetCode
- Tree: Height of a Binary Tree on HackerRank
- Tree: Top View on HackerRank
- Univalued Binary Tree on LeetCode
- Validate Binary Search Tree on LeetCode
- Trie
- Graph
- SQL
- Uncategorized
- Array
$ poetry install
$ poetry run pytest --benchmark-skip
If you don't use poetry, there is also a classic requirements-dev.txt
file.
If you find any bug or incorrect implementation in this repo, please let me know by opening an issue or pull request. Me and my cats would appreciate your help since they provide some random strings which are used in two of test cases.