-
This repository contains JavaScript attempts on algorithm and data structures questions gotten from multiple sources such as Cracking the Coding Interview (CTCI) 6th edition, HackerRank and Leetcode.
-
The files only contain code, and do not contain ANY question. For CTCI questions, please support Gayle Laakmann McDowell by purchasing the book. For other questions you can find them for free on their respective platforms.
-
In each JavaScript file, there are simple tests to check that the code is working as expected. For convenience, simple logging is used to test the functions. In your terminal type
node <path-to-fileName>.js
to run the tests. -
Contributions welcome
- Count Anagrams - CTCI
- Check Permutation - CTCI
- URLify - CTCI
- Palindrome Permutation - CTCI
- One Away - CTCI
- String Compression - CTCI
- Rotate Matrix - CTCI
- Zero Matrix - CTCI
- String Rotation - CTCI
- Minimum Bribes - HackerRank
- Minimum Swaps 2 - HackerRank
- Array Manipulation - HackerRank
- Sherlock and the Valid String - HackerRank
- Special String Again - HackerRank
- String to Dictionary
- Common Child - HackerRank
- Football Scores - HackerRank coding interview question
- Sherlock and Anagrams - HackerRank
- Count Triplets - HackerRank
- Frequency Queries - HackerRank
- Remove Dups - CTCI
- Return Kth to Last - CTCI
- Delete Middle Node - CTCI
- Partition - CTCI
- Sum Lists - CTCI
- Palindrome - CTCI
- Intersection - CTCI
- Loop Detection - CTCI
- Three in One - CTCI
- Stack Min - CTCI
- Stack of Plates - CTCI
- Queue via Stacks - CTCI
- Sort Stack - CTCI
- Animal Shelter - CTCI
- Balanced Brackets - HackerRank
- Largest Rectangle - HackerRank
- Min Max Riddle - HackerRank
- Poisonous Plants - HackerRank
- Castle on the Grid - HackerRank
- Auto Suggest
- Route Between Nodes - CTCI
- Minimal Tree - CTCI
- List of Depths - CTCI
- Check Balanced - CTCI
- Validate BST - CTCI
- Successor - CTCI
- Build Order - CTCI
- First Common Ancestor - CTCI
- BST Sequences - CTCI
- Check Subtree - CTCI
- Random Node - CTCI
- Paths with Sum - CTCI
- Roads and Libraries - HackerRank
- Find the nearest clone - HackerRank
- BFS: Shortest Reach in a Graph - HackerRank
- DFS: Connected Cell in a Grid - HackerRank
- Matrix - HackerRank
- Tree: Huffman Decoding - HackerRank
- Insertion - CTCI
- Binary to String - CTCI
- Flip Bit to Win - CTCI
- Next Number - CTCI
- Conversion - CTCI
- Deck of Cards - CTCI
- Call Center - CTCI
- Jigsaw - CTCI
- Triple Step - CTCI
- Robot in a Grid - CTCI
- Towers of Hanoi - CTCI
- Coins - CTCI
- Crossword Puzzle - HackerRank
- Knapsack - HackerRank
- Construct Target Word
- Abbreviation - HackerRank
- Friend Circle Queries - HackerRank
npm test