β algo-expert
Description: This is a collection of all AlgoExpert Coding Interview questions that are currently available on the platform. There are solutions for each problem statement including time and space complexity. Since AlgoExpert is a paid platform, everyone doesn't have access to it or can't afford to. I hope this helps everyone to access the content and improve their problem solving skills.
Solutions: The solutions are provided in Python.
β‘ LIST OF PROBLEMS
β : Coding Interview Problems
Difficulty chart:
β¬ : Very Hard
Problem Statement | Difficulty | Solution | |
---|---|---|---|
Two Number Sum | two-number-sum.py | ||
β | Validate Subsequence | validate-subsequence.py | |
Tournament Winner | tournament-winner.py | ||
Non-Constructible Change | non-constructible-change.py | ||
Find Closest Value in BST | π© | closest-in-BST.py | |
β | Branch Sums | branch-sums.py | |
Node Depths | node-depths.py | ||
Depth First Search | π© | depth-first-search.py | |
Minimum Waiting Time | π© | minimum-waiting-time.py | |
β | Class Photos | π© | class-photos.py |
Remove Duplicates from Linked List | remove-duplicates.py | ||
Nth Fibonacci | nth-fibonacci.py | ||
Validate Subsequence | validate-subsequence.py | ||
Product Sum | π© | product-sum.py | |
β | Binary Search | binary-search.py | |
β | Find Three Largest Numbers | π© | find-three-largest-numbers.py |
β | Bubble Sort | bubble-sort.py | |
Insertion Sort | insertion-sort.py | ||
Selection Sort | selection-sort.py | ||
Palindrome Check | palindrome-check.py | ||
Caesar Cipher Encryptor | caesar-cipher-encryptor.py | ||
β | Run Length Encoding | run-length-encoding.py | |
Generate Document | π© | generate-document.py | |
β | Sorted Square Array | sorted-square-array.py | |
First Non Repeating Character | first-non-repeating-character.py | ||
Tandem Bicycle | tandem-bicycle.py | ||
β | Three Number Sum | three-number-sum.py | |
Smallest Difference | π¦ | smallest-difference.py | |
Move Element to End | π¦ | move-element-to-end.py | |
Monotonic Array | π¦ | monotonic-array.py | |
Spiral Traverse | spiral-traverse.py | ||
Longest Peak | longest-peak.py | ||
Array of Products | array-of-products.py | ||
β | First Duplicate Value | first-duplicate-value.py | |
Merge Overlapping Intervals | π¦ | merge-overlapping-intervals.py | |
BST Construction | π¦ | bst-construction.py | |
β | Validate BST | validate-bst.py | |
BST Traversal | bst-traversal.py | ||
Min Height BST | min-height-bst.py | ||
β | Find Kth Largest Value In BST | find-kth-largest-value-in-bst.py | |
Reconstruct BST | reconstruct-bst.py | ||
Invert Binary Tree | invert-binary-tree.py | ||
Binary Tree Diameter | binary-tree-diameter.py | ||
Height Balanced Binary Tree | π¦ | height-balanced-binary-tree.py | |
Max Subset Sum No Adjacent | π¦ | max-subset-sum-no-adjacent.py | |
Number of Ways to Make Change | ways-to-make-change.py | ||
Min Number of Coins for Change | min-number-of-coins-for-change.py | ||
Levenshtein Distance | levenshtein-distance.py | ||
Kadane's Algorithm | kadane's-algorithm.py | ||
β | Single Cycle Check | π¦ | single-cycle-check.py |
β | Breadth First Search | breadth-first-search.py | |
β | Youngest Common Ancestor | youngest-common-ancestor.py | |
β | Remove Islands | remove-islands.py | |
Cycle In Graph | cycle-in-graph.py | ||
Minimum Passes of Matrix | minimum-passes-of-matrix.py | ||
Task Assignment | task-assignment.py | ||
Valid Starting City | valid-starting-city.py | ||
Min Heap Construction | min-heap-construction.py | ||
Linked List Construction | linked-list-construction.py | ||
β | Remove Kth Node From End | remove-kth-node-from-end.py | |
Sum of Linked Lists | sum-of-linked-lists.py | ||
β | Permutations | π¦ | permutations.py |
β | Powerset | powerset.py | |
Phone Number Mnemonics | phone-number-mnemonics.py | ||
Staircase Traversal | staircase-traversal.py | ||
Search in Sorted matrix | search-in-sorted-matrix.py | ||
Three Number Sort | three-number-sort.py | ||
Min Max Stack construction | min-max-stack-construction.py | ||
Balanced Brackets | balanced-brackets.py | ||
Sunset Views | sunset-views.py | ||
Sort Stack | sort-stack.py | ||
Next Greater Element | next-greater-element.py | ||
β | Group Anagrams | group-anagrams.py | |
Valid IP Addresses | π¦ | valid-ip-addresses.py | |
Reverse Words In String | π¦ | reverse-words-in-string.py | |
β | Minimum Characters For Words | minimum-characters-for-words.py | |
Suffix Trie Construction | suffix-trie-construction.py | ||
Four Number Sum | four-number-sum.py | ||
Subarray Sort | π₯ | subarray-sort.py | |
Largest Range | largest-range.py | ||
Min Rewards | π₯ | min-rewards.py | |
β | Zigzag Traverse | zigzag-traverse.py | |
Same bsts | π₯ | same-bsts.py | |
Validate Three Nodes | validate-three-nodes.py | ||
Max Path Sum In Binary Tree | max-path-sum-in-binary-tree.py | ||
β | Find Nodes Distance K | π₯ | find-nodes-distance-k.py |
Longest Common Subsequence | longest-common-subsequence.py | ||
Min Number of Jumps | π₯ | min-number-of-jumps.py | |
β | Water Area | water-area.py | |
β | Knapsack Problem | π₯ | knapsack-problem.py |
β | Disk Stacking | π₯ | disk-stacking.py |
Numbers in Pi | π₯ | numbers-in-pi.py | |
β | Maximum Sum Submatrix | maximum-sum-submatrix.py | |
β | Dijkstra Algorithm | dijkstra-algorithm.py | |
β | Topological Sort | topological-sort.py | |
Boggle Board | π₯ | boggle-board.py | |
Continuous Median | π₯ | continuous-median.py | |
β | Sort K Sorted Array | π₯ | sort-k-sorted-array.py |
Laptop Rentals | laptop-rentals.py | ||
Find Loop | π₯ | find-loop.py | |
Reverse Linked List | reverse-linked-list.py | ||
Merge Linked Lists | merge-linked-lists.py | ||
Shift Linked Lists | shift-linked-lists.py | ||
Lowest Common Manager | lowest-common-manager.py | ||
Solve Sudoku | solve-sudoku.py | ||
β | Generate Div Tags | generate-div-tags.py | |
Ambiguous Measurements | ambiguous-measurements.py | ||
Shifted Binary Search | shifted-binary-search.py | ||
Search For Range | π₯ | search-for-range.py | |
Quickselect | quickselect.py | ||
β | Index Equals Value | index-equals-value.py | |
Quick Sort | quick-sort.py | ||
Heap Sort | heap-sort.py | ||
Radix Sort | radix-sort.py | ||
Shorten Path | shorten-path.py | ||
Largest Rectangle Under Skyline | largest-rectangle-under-skyline.py | ||
Longest Substring Without Duplication | longest-substring-without-duplication.py | ||
β | Underscorify Substring | underscorify-substring.py | |
Pattern Matcher | pattern-matcher.py | ||
Multi String Search | π₯ | multi-string-search.py | |
β | Apartment Hunting | β¬ | apartment-hunting.py |
Calendar Matching | calendar-matching.py | ||
Waterfall Streams | waterfall-streams.py | ||
β | Minimum Area Rectangle | minimum-area-rectangle.py | |
Line Through Points | line-through-points.py | ||
β | Right Smaller Than | right-smaller-than.py | |
Iterative Inorder Traversal | iterative-inorder-traversal.py | ||
Flatten Binary Tree | flatten-binary-tree.py | ||
Right Sibling Tree | right-sibling-tree.py | ||
β | All Kinds of Node Depths | β¬ | all-kinds-of-node-depths.py |
β | Compare Leaf Traversal | compare-leaf-traversal.py | |
β | Max Profits With K Transactions | β¬ | max-profits-with-k-transactions.py |
β | Palindrome Partitioning Min Cuts | palindrome-partitioning-min-cuts.py | |
β | Longest Increasing Subsequence | longest-increasing-subsequence.py | |
Longest String Chain | β¬ | longest-string-chain.py | |
Square Of Zeroes | square-of-zeroes.py | ||
β | A Star Algorithm | A-star-algorithm.py | |
Detect Arbitrage | detect-arbitrage.py | ||
Airport Connections | airport-connections.py | ||
Merge Sorted Arrays | β¬ | merge-sorted-arrays.py | |
LRU Cache | LRU-cache.py | ||
Rearrange Linked List | rearrange-linked-list.py | ||
Linked List Palindrome | β¬ | linked-list-palindrome.py | |
Zip Linked List | zip-linked-list.py | ||
β | Node Swap | node-swap.py | |
Number of Binary Tree Topologies | number-of-binary-tree-topologies.py | ||
β | Non Attacking Queens | non-attacking-queens.py | |
Merge Sort | β¬ | merge-sort.py | |
Count Inversions | count-inversions.py | ||
Longest Balanced Substring | longest-balanced-substring.py |
β‘ HOW TO
You can visit this page and download the latest Python release version: Install Python
After you complete the download and install, you can run any solution by writing a 'main' section in the file so that the compiler knows the sequence of methods to call when executing the script.
For example, in case of 'Two Number Sum' problem:
if __name__=='__main__':
print(twoNumberSum([1,3,4,5], 7))
The code can be executed like this:
python easy/twoNumberSum.py
β‘ CONTRIBUTE, CONTRIBUTE, CONTRIBUTE!
This is not near to perfect. So please feel free to fork this repo and add any solution in different languages here. You can even add test cases to make this robust. Let's help each other grow!
β‘ EXTRAS
I also have a collection of Leetcode questions that I keep growing. Feel free to visit and have a look. It has more than 200 questions + solutions and also basic concepts grouped by category.