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.
β : Coding Interview Problems
π© : Easy
π¦ : Medium
π₯ : Hard
β¬ : 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 |
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
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! π
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. π½