My solutions to various algorithmic and interview prep questions. At the time of making this repo 208 questions have already been solved across sites. Some but not all previously solved problems will make it here.
My passing solutions are taken directly from each website. As some sites may include non-standard headers or environments I cannot access, solutions here are not generally meant to be run as is.
Requires Rust-lang installed with cargo.
Run cargo run
.
- Easy: 47
- Medium: 39
- Hard: 12
- Very Hard: 2
Total: 100
- C++: 88
- Rust: 19
- Python: 13
Total: 120
- Easy: 25
- Medium: 39
- Hard: 12
- Very Hard: 2
Total: 78
- C++: 77
- Python: 13
Total: 90
Problem Name | Difficulty | C++ | Python |
---|---|---|---|
Binary Search | Easy | .cc | |
Branch Sums | Easy | .cc | .py |
Bubble Sort | Easy | .cc | |
Caesar Cipher Encryptor | Easy | .cc | |
Class Photos | Easy | .cc | .py |
Depth First Search | Easy | .cc | |
Find Closest Value In Bst | Easy | .cc | |
Find Three Largest Numbers | Easy | .cc | .py |
First Non Repeating Character | Easy | .cc | |
Generate Document | Easy | .cc | .py |
Insertion Sort | Easy | .cc | |
Minimum Waiting Time | Easy | .cc | .py |
Node Depths | Easy | .cc | |
Non Constructible Change | Easy | .cc | |
Nth Fibonacci | Easy | .cc | |
Palindrome Check | Easy | .cc | .py |
Product Sum | Easy | .cc | .py |
Remove Duplicates From Linked List | Easy | .cc | |
Run Length Encoding | Easy | .cc | |
Selection Sort | Easy | .cc | |
Sorted Squared Array | Easy | .cc | |
Tandem Bicycle | Easy | .cc | .py |
Tournament Winner | Easy | .cc | |
Two Number Sum | Easy | .cc | .py |
Validate Subsequence | Easy | .cc | |
Array Of Products | Medium | .cc | |
BST Traversal | Medium | .cc | |
Balanced Brackets | Medium | .cc | |
Binary Tree Diameter | Medium | .cc | |
Breadth First Search | Medium | .cc | |
Find Kth Largest Value In Bst | Medium | .cc | |
First Duplicate Value | Medium | .cc | |
Group Anagrams | Medium | .cc | |
Height Balanced Binary Tree | Medium | .cc | |
Invert Binary Tree | Medium | .cc | |
Kadanes Algorithm | Medium | .cc | |
Longest Palindromic Substring | Medium | .cc | |
Longest Peak | Medium | .cc | |
Max Subset Sum No Adjacent | Medium | .cc | |
Merge Overlapping Intervals | Medium | .cc | |
Min Height BST | Medium | .cc | |
Min Max Stack Construction | Medium | .cc | |
Min Number Of Coins For Change | Medium | .cc | |
Minimum Characters For Words | Medium | .cc | |
Minimum Passes Of Matrix | Medium | .cc | |
Monotonic Array | Medium | .cc | |
Move Element To End | Medium | .cc | |
Next Greater Element | Medium | .cc | |
Number Of Ways To Make Change | Medium | .cc | |
Number Of Ways To Traverse Graph | Medium | .cc | .py |
Phone Number Mnemonics | Medium | .cc | |
Remove Kth Node From End | Medium | .cc | |
River Sizes | Medium | .py | |
Search In Sorted Matrix | Medium | .cc | |
Single Cycle Check | Medium | .cc | |
Smallest Difference | Medium | .cc | |
Spiral Traverse | Medium | .cc | |
Staircase Traversal | Medium | .cc | |
Sum Of Linked Lists | Medium | .cc | |
Sunset Views | Medium | .cc | |
Task Assignment | Medium | .cc | .py |
Three Number Sort | Medium | .cc | |
Validate Bst | Medium | .cc | |
Youngest Common Ancestor | Medium | .cc | |
Continuous Median | Hard | .cc | |
Generate Div Tags | Hard | .cc | |
Largest Range | Hard | .cc | |
Merge Linked Lists | Hard | .cc | |
Min Rewards | Hard | .cc | |
Quick Sort | Hard | .cc | |
Reverse Linked List | Hard | .cc | |
Search For Range | Hard | .cc | |
Shift Linked List | Hard | .cc | |
Topological Sort | Hard | .cc | |
Validate Three Nodes | Hard | .cc | |
Water Area | Hard | .cc | |
Airport Connections | Very Hard | .cc | |
Node Swap | Very Hard | .cc | .py |
- Easy: 22
- Medium: 0
- Hard: 0
- Very Hard: 0
Total: 22
- C++: 11
- Rust: 19
Total: 30
Problem Name | Difficulty | C++ | Rust |
---|---|---|---|
1 Two Sum | Easy | .rs | |
1684 Count The Number Of Consistent Strings | Easy | .cc | .rs |
1720 Decode XORed Array | Easy | .cc | .rs |
1732 Find The Highest Altitude | Easy | .rs | |
1748 Sum Of Unique Elements | Easy | .rs | |
1844 Replace All Digits With Characters | Easy | .cc | |
1876 Substrings Of Size Three With Distinct Characters | Easy | .rs | |
203 Remove Linked List Elements | Easy | .cc | |
2124 Check If All As Appears Before All Bs | Easy | .cc | .rs |
217 Contains Duplicate | Easy | .cc | .rs |
219 Contains Duplicate II | Easy | .cc | .rs |
226 Invert Binary Tree | Easy | .rs | |
228 Summary Ranges | Easy | .rs | |
268 Missing Number | Easy | .rs | |
495 Teemo Attacking | Easy | .rs | |
496 Next Greater Element I | Easy | .cc | .rs |
551 Student Attendance Record I | Easy | .cc | .rs |
599 Minimum Index Sum Of Two Lists | Easy | .cc | .rs |
876 Middle Of The Linked List | Easy | .cc | |
944 Delete Columns To Make Sorted | Easy | .rs | |
953 Verifying An Alien Dictionary | Easy | .rs | |
997 Find The Town Judge | Easy | .rs |