My solutions to challenges from the HackerRank's Interview Preparation Kit. Solutions are written in Go or C++ (where it wasn't possible to use Go). I think they're quite easy to understand and as compact as possible at the same time.
Warning: solutions are mine and every approach might be biased and/or suboptimal (though passing all test cases).
- Arrays
- 2D Array - DS
- Arrays: Left Rotation
- New Year Chaos
- Minimum Swaps 2
- Array Manipulation
- Dictionaries and Hashmaps
- Hash Tables: Ransom Note
- Two Strings
- Sherlock and Anagrams
- Count Triplets
- Frequency Queries
- Dynamic Programming
- Max Array Sum
- Abbreviation
- Candies
- Decibinary Numbers
- Greedy Algorithms
- Minimum Absolute Difference in an Array
- Luck Balance
- Greedy Florist
- Max Min
- Reverse Shuffle Merge
- Linked Lists
- Insert a node at a specific position in a linked list
- Inserting a Node Into a Sorted Doubly Linked List
- Reverse a doubly linked list
- Find Merge Point of Two Lists
- Linked Lists: Detect a Cycle
- Miscellaneous
- Flipping bits
- Time Complexity: Primality
- Friend Circle Queries
- Maximum Xor
- Recursion and Backtracking
- Recursion: Fibonacci Numbers
- Recursion: Davis' Staircase
- Crossword Puzzle
- Recursive Digit Sum
- Search
- Hash Tables: Ice Cream Parlor
- Swap Nodes [Algo]
- Pairs
- Triple sum
- Minimum Time Required
- Maximum Subarray Sum
- Making Candies
- Sorting
- Sorting: Bubble Sort
- Mark and Toys
- Sorting: Comparator
- Fraudulent Activity Notifications
- Merge Sort: Counting Inversions
- Stacks and Queues
- Balanced Brackets
- Queues: A Tale of Two Stacks
- Largest Rectangle
- Min Max Riddle
- Castle on the Grid
- Poisonous Plants
- String Manipulation
- Strings: Making Anagrams
- Alternating Characters
- Sherlock and the Valid String
- Special String Again
- Common Child
- Trees
- Tree: Height of a Binary Tree
- Binary Search Tree : Lowest Common Ancestor
- Trees: Is This a Binary Search Tree?
- Tree: Huffman Decoding
- Balanced Forest
- Warm-up Challenges
- Sock Merchant
- Counting Valleys
- Jumping on the Clouds
- Repeated String
⚫⚫⚫⚫⚫⚫⚫⚪⚪⚪ 71%
This repo is still a work in progress.