Playing with HackerRank challenges (my profile) for fun, but also to stay sharp and brush up on Computer Science fundamentals that so frequently pop up in FAANG style tech interviews. Solutions are coded in Java 8 and pass all available tests to earn full points.
Each solution's Result.java
class comes with a corresponding set of unit tests.
Using JUnit 5 along with AssertJ
library for its convenient and fluent assertions. Test method names follow naming standard as
outlined here.
Total problems solved: 73
Category | Problem | Difficulty | Solution |
---|---|---|---|
Arrays (1): | |||
Sparse Arrays | Medium | Result - Unit Test | |
Heap (1): | |||
Find the Running Median | Hard | Result - Unit Test |
TODO: Convert each problem to new format and add unit tests.
Category | Name | Difficulty | Problem | Solution |
---|---|---|---|---|
Sorting (2): | ||||
Counting Sort Part 3 | Easy | Problem | Solution | |
Counting Sort Part 4 | Moderate | Problem | Solution | |
Search (6): | ||||
Sherlock and Array | Easy | Problem | Solution | |
Ice Cream Parlor | Easy | Problem | Solution | |
Missing Numbers | Moderate | Problem | Solution | |
Connected Cells | Moderate | Problem | Solution | |
Count Luck | Easy | Problem | Solution | |
Cut the Tree | Moderate | Problem | Solution | |
Graph Theory (7): | ||||
Breadth Shortest Reach | Moderate | Problem | Solution | |
Dijkstra Shortest Reach | Difficult | Problem | Solution | |
Prim's Special Subtree | Moderate | Problem | Solution | |
Kruskal's Really Special Subtree | Difficult | Problem | Solution | |
Even Tree | Moderate | Problem | Solution | |
Journey to the Moon | Moderate | Problem | Solution | |
Snakes and Ladders | Easy | Problem | Solution | |
Greedy (9): | ||||
Grid Challenge | Easy | Problem | Solution | |
Jim and the Orders | Easy | Problem | Solution | |
Mark and Toys | Easy | Problem | Solution | |
Two Arrays | Easy | Problem | Solution | |
Priyanka and Toys | Easy | Problem | Solution | |
Largest Permutation | Easy | Problem | Solution | |
Flowers | Moderate | Problem | Solution | |
Cutting Boards | Moderate | Problem | Solution | |
Max Min | Moderate | Problem | Solution | |
Dynamic Programming (4): | ||||
Fibonacci Modified | Moderate | Problem | Solution | |
Coin Change | Moderate | Problem | Solution | |
Candies | Moderate | Problem | Solution | |
Stock Maximize | Moderate | Problem | Solution |