Skip to content

A collection of solutions for all problem I solved in JavaScript and Swift on the AlgoExpert Coding Interview platform.

License

Notifications You must be signed in to change notification settings

leandrolima-nyc/coding-Interview-jorney

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

64 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Coding Interview Journey:
A Collection of Problem-Solving Solutions

GitHub last commit GitHub repo size in bytes Contributors Forks Stargazers Issues MIT License LinkedIn language-js language-swift

A curated collection of solutions I have cooked up while tackling problems from Coding Interview platforms. Most of the problems have at least two solutions. But if a problem is too easy, I just keep it simple.

Initially, I jump into each problem with a πŸ’‘blank slate, without of any external resources or prior research. Then, after I solve it, I engage in thorough online study, analyzing the best solutions available 🎯, exploring different angles and approaches. Armed with these new ideas, I reconstruct the problems using my own understanding and methodologies.

Let's face it, sometimes I make mistakes! Even though my first attempt works for the basic examples, different scenarios pop up. That means I have to go back and tweak things until they're perfect. And even after my solution passes all the tests, there's always that one tricky situation my code can't handle.

That's when I have to get creative and come up with a totally new way to solve it. πŸ”—Β water-area

Each solution I present is accompanied by a detailed explanation, providing insights into its time and space complexities. I'm thrilled to share this project, and hope you'll find them as enlightening and enjoyable as I do while working on it.

Show your support by giving it a STAR ⭐️


two-number-sumvalidate-subsequencewater-area

Problem Statement Hurdle Category Solutions Paper
Two Number Sum 🟩 Arrays js-icon swift-icon check-icon
Validate Subsequence 🟩 Arrays js-icon swift-icon check-icon
Tournament Winner 🟩 Arrays
Non-Constructible Change 🟩 Arrays
Sorted Squared Array 🟩 Arrays
Three Number Sum 🟦 Arrays
Smallest Difference 🟦 Arrays
Move Element To End 🟦 Arrays
Monotonic Array 🟦 Arrays
Spiral Traverse 🟦 Arrays
Longest Peak 🟦 Arrays
Array Of Products 🟦 Arrays
First Duplicate Value 🟦 Arrays
Merge Overlapping Intervals 🟦 Arrays
Four Number Sum πŸŸ₯ Arrays
Subarray Sort πŸŸ₯ Arrays
Largest Range πŸŸ₯ Arrays
Min Rewards πŸŸ₯ Arrays
Zigzag Traverse πŸŸ₯ Arrays
Apartment Hunting ⬛ Arrays
Calendar Matching ⬛ Arrays
Waterfall Streams ⬛ Arrays
Minimum Area Rectangle ⬛ Arrays
Line Through Points ⬛ Arrays
Palindrome Check 🟩 Strings
Caesar Cypher Encryptor 🟩 Strings
Run-Length Encoding 🟩 Strings
Generate Document 🟩 Strings
First Non-Repeating Character 🟩 Strings
Longest Palindromic Substring 🟦 Strings
Group Anagrams 🟦 Strings
Valid IP Addresses 🟦 Strings
Reverse Words In String 🟦 Strings
Minimum Characters For Words 🟦 Strings
Longest Substring Without Duplication πŸŸ₯ Strings
Underscorify Substring πŸŸ₯ Strings
Pattern Matcher πŸŸ₯ Strings
Smallest Substring Containing ⬛ Strings
Longest Balanced Substring ⬛ Strings
Remove Duplicates From Linked List 🟩 Linked Lists
Linked List Construction 🟦 Linked Lists
Remove Kth Node From End 🟦 Linked Lists
Sum of Linked Lists 🟦 Linked Lists
Find Loop πŸŸ₯ Linked Lists
Reverse Linked List πŸŸ₯ Linked Lists
Merge Linked Lists πŸŸ₯ Linked Lists
Shift Linked List πŸŸ₯ Linked Lists
LRU Cache ⬛ Linked Lists
Rearrange Linked List ⬛ Linked Lists
Linked List Palindrome ⬛ Linked Lists
Zip Linked List ⬛ Linked Lists
Node Swap ⬛ Linked Lists
Min Max Stack Construction 🟦 Stacks
Balanced Brackets 🟦 Stacks
Sunset Views 🟦 Stacks
Sort Stack 🟦 Stacks
Shorten Path πŸŸ₯ Stacks
Largest Rectangle Under Skyline πŸŸ₯ Stacks
Binary Search 🟩 Searching
Find Three Largest Numbers 🟩 Searching
Search In Sorted Matrix 🟦 Searching
Shifted Binary Search πŸŸ₯ Searching
Search For Range πŸŸ₯ Searching
Quickselect πŸŸ₯ Searching
Index Equals Value πŸŸ₯ Searching
Bubble Sort 🟩 Sorting
Insertion Sort 🟩 Sorting
Selection Sort 🟩 Sorting
Three Number Sort 🟦 Sorting
Quick Sort πŸŸ₯ Sorting
Heap Sort πŸŸ₯ Sorting
Radix Sort πŸŸ₯ Sorting
Merge Sort ⬛ Sorting
Minimum Waiting Time 🟩 Greedy Algorithms
Class Photos 🟩 Greedy Algorithms
Tandem Bicycle 🟩 Greedy Algorithms
Task Assignment 🟦 Greedy Algorithms
Valid Starting City 🟦 Greedy Algorithms
Min Heap Construction 🟦 Heaps
Continuous Median πŸŸ₯ Heaps
Sort K-Sorted Array πŸŸ₯ Heaps
Laptop Rentals πŸŸ₯ Heaps
Merge Sorted Arrays ⬛ Heaps
Kadane's Algorithm 🟦 Famous Algorithms
Dijkstra's Algorithm πŸŸ₯ Famous Algorithms
Topological Sort πŸŸ₯ Famous Algorithms
Knuth Morris Pratt Algorithm ⬛ Famous Algorithms
A* Algorithm ⬛ Famous Algorithms
Nth Fibonacci 🟩 Recursion
Product Sum 🟩 Recursion
Permutations 🟦 Recursion
Powerset 🟦 Recursion
Phone Number Mnemonics 🟦 Recursion
Staircase Traversal 🟦 Recursion
Lowest Common Manager πŸŸ₯ Recursion
Interweaving Strings πŸŸ₯ Recursion
Solve Sudoku πŸŸ₯ Recursion
Ambiguous Measurements πŸŸ₯ Recursion
Generate Div Tags πŸŸ₯ Recursion
Number Of Binary Tree Topologies ⬛ Recursion
Non Attacking Queens ⬛ Recursion
Find Closest Value In BST 🟩 Binary Search Trees
BST Traversal 🟦 Binary Search Trees
BST Construction 🟦 Binary Search Trees
Validate BST 🟦 Binary Search Trees
Min Height BST 🟦 Binary Search Trees
Find Kth Largest Value In BST 🟦 Binary Search Trees
Reconstruct BST 🟦 Binary Search Trees
Validate Three Nodes πŸŸ₯ Binary Search Trees
Same BSTs πŸŸ₯ Binary Search Trees
Right Smaller Than ⬛ Binary Search Trees
Branch Sums 🟩 Binary Trees
Node Depths 🟩 Binary Trees
Invert Binary Tree 🟦 Binary Trees
Binary Tree Diameter 🟦 Binary Trees
Find Successor 🟦 Binary Trees
Height Balanced Binary Tree 🟦 Binary Trees
Max Path Sum In Binary Tree πŸŸ₯ Binary Trees
Find Nodes Distance K πŸŸ₯ Binary Trees
Iterative In-Order Traversal ⬛ Binary Trees
Flatten Binary Tree ⬛ Binary Trees
Right Sibling Tree ⬛ Binary Trees
All Kinds of Node Depths ⬛ Binary Trees
Compare Leaf Traversal ⬛ Binary Trees
Max Subset Sum No Adjacent 🟦 Dynamic Programming
Number Of Ways To Make Change 🟦 Dynamic Programming
Min Number Of Coins For Change 🟦 Dynamic Programming
Levenshtein Distance 🟦 Dynamic Programming
Number Of Ways To Traverse Graph 🟦 Dynamic Programming
Max Sum Increasing Subsequence πŸŸ₯ Dynamic Programming
Longest Common Subsequence πŸŸ₯ Dynamic Programming
Min Number of Jumps πŸŸ₯ Dynamic Programming
Water Area πŸŸ₯ Dynamic Programming js-iconΒ swift-icon inprogress-icon
Knapsack Problem πŸŸ₯ Dynamic Programming
Disk Stacking πŸŸ₯ Dynamic Programming
Numbers In Pi πŸŸ₯ Dynamic Programming
Maximum Sum Submatrix πŸŸ₯ Dynamic Programming
Maximize Expression πŸŸ₯ Dynamic Programming
Max Profit With K Transactions ⬛ Dynamic Programming
Palindrome Partitioning Min Cuts ⬛ Dynamic Programming
Longest Increasing Subsequence ⬛ Dynamic Programming
Longest String Chain ⬛ Dynamic Programming
Square Of Zeroes ⬛ Dynamic Programming
Depth-First Search 🟩 Graphs
Single Cycle Check 🟦 Graphs
Breadth-First Search 🟦 Graphs
River Sizes 🟦 Graphs
Youngest Common Ancestor 🟦 Graphs
Remove Islands 🟦 Graphs
Cycle In Graph 🟦 Graphs
Minimum Passes Of Matrix 🟦 Graphs
Boggle Board πŸŸ₯ Graphs
Rectangle Mania ⬛ Graphs
Airport Connections ⬛ Graphs
Detect Arbitrage ⬛ Graphs
Two-Edge Connected Graph ⬛ Graphs
Suffix Trie Construction 🟦 Tries
Multi String Search πŸŸ₯ Tries
Color Description
🟩 Easy
🟦 Medium
πŸŸ₯ Hard
⬛ Very Hard

About

A collection of solutions for all problem I solved in JavaScript and Swift on the AlgoExpert Coding Interview platform.

Topics

Resources

License

Stars

Watchers

Forks