(Highly Efficient:zap:) solutions to problems on HackerRank implemented with Python.
| hackerrank | algorithms| data structures | mathematics | c | c++ | java | python | ruby | linux shell | functional programming | artificial intelligence | sql | databases | regex | interview preparation kit |30 days of code| 10 days of statistics |10 days of javascript |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Solve Me First | Solution | Easy | 1 | Warmup |
| 2 | Simple Array Sum | Solution | Easy | 10 | Warmup |
| 3 | Compare the Triplets | Solution | Easy | 10 | Warmup |
| 4 | A Very Big Sum | Solution | Easy | 10 | Warmup |
| 5 | Diagonal Difference | Solution | Easy | 10 | Warmup |
| 6 | Plus Minus | Solution | Easy | 10 | Warmup |
| 7 | Staircase | Solution | Easy | 10 | Warmup |
| 8 | Mini-Max Sum | Solution | Easy | 10 | Warmup |
| 9 | Birthday Cake Candles | Solution | Easy | 10 | Warmup |
| 10 | Time Conversion | Solution | Easy | 15 | Warmup |
| 11 | Grading Students | Solution | Easy | 10 | Implementation |
| 12 | Apple and Orange | Solution | Easy | 10 | Implementation |
| 13 | Kangaroo | Solution | Easy | 10 | Implementation |
| 14 | Breaking the Records | Solution | Easy | 10 | Implementation |
| 15 | Forming a Magic Square | Solution | Medium | 20 | Implementation |
| 16 | Find Digits | Solution | Easy | 25 | Implementation |
| 17 | Extra Long Factorials | Solution | Medium | 20 | Implementation |
| 18 | Append and Delete | Solution | Easy | 20 | Implementation |
| 19 | Sherlock and Squares | Solution | Easy | 20 | Implementation |
| 20 | Matrix Layer Rotation | Solution | Hard | 80 | Implementation |
| 21 | Super Reduced String | Solution | Easy | 10 | Implementation |
| 22 | Sherlock and The Beast | Solution | Easy | 30 | Greedy |
| 23 | Max Min | Solution | Medium | 35 | Greedy |
| 24 | Goodland Electricity | Solution | Medium | 40 | Greedy |
| 25 | Lonely Integer | Solution | Easy | 20 | Bit Manipulation |
| 26 | The Coin Change Problem | Solution | Medium | 60 | Dynamic Programming |
| 27 | Equal | Solution | Medium | 30 | Dynamic Programming |
| 28 | Greedy Florist | Solution | Medium | 35 | Greedy |
| 29 | Sherlock and Cost | Solution | Medium | 50 | Dynamic Programming |
| 30 | Jim and the Orders | Solution | Easy | 40 | Greedy |
| 31 | Permuting Two Arrays | Solution | Easy | 40 | Greedy |
| 32 | Construct the Array | Solution | Medium | 35 | Dynamic Programming |
| 33 | Minimum Absolute Difference in an Array | Solution | Easy | 15 | Greedy |
| 34 | Marc's Cakewalk | Solution | Easy | 15 | Greedy |
| 35 | Grid Challenge | Solution | Easy | 20 | Greedy |
| 36 | Luck Balance | Solution | Easy | 20 | Greedy |
| 37 | Maximum Perimeter Triangle | Solution | Easy | 20 | Greedy |
| 38 | Candies | Solution | Medium | 50 | Greedy |
| 39 | Beautiful Pairs | Solution | Easy | 30 | Greedy |
| 40 | Sam and substrings | Solution | Medium | 40 | Dynamic Programming |
| 41 | Priyanka and Toys | Solution | Easy | 30 | Greedy |
| 42 | Fibonacci Modified | Solution | Medium | 45 | Dynamic Programming |
| 43 | Largest Permutation | Solution | Easy | 30 | Greedy |
| 44 | Mark and Toys | Solution | Easy | 35 | Greedy |
| 45 | Abbreviation | Solution | Medium | 40 | Dynamic Programming |
| 46 | Chief Hopper | Solution | Hard | 65 | Greedy |
| 47 | Between Two Sets | Solution | Easy | 10 | Implementation |
| 48 | Sub-array Division | Solution | Easy | 10 | Implementation |
| 49 | Divisible Sum Pairs | Solution | Easy | 10 | Implementation |
| 50 | Migratory Birds | Solution | Easy | 10 | Implementation |
| 51 | Day of the Programmer | Solution | Easy | 15 | Implementation |
| 52 | Bill Division | Solution | Easy | 10 | Implementation |
| 53 | Drawing Book | Solution | Easy | 10 | Implementation |
| 54 | Electronics Shop | Solution | Easy | 15 | Implementation |
| 55 | Cats and a Mouse | Solution | Easy | 15 | Implementation |
| 56 | Picking Numbers | Solution | Easy | 20 | Implementation |
| 57 | Climbing the Leaderboard | Solution | Medium | 20 | Implementation |
| 58 | The Hurdle Race | Solution | Easy | 15 | Implementation |
| 59 | Designer PDF Viewer | Solution | Easy | 20 | Implementation |
| 60 | Utopian Tree | Solution | Easy | 20 | Implementation |
| 61 | Angry Professor | Solution | Easy | 20 | Implementation |
| 62 | Beautiful Days at the Movies | Solution | Easy | 15 | Implementation |
| 63 | Viral Advertising | Solution | Easy | 15 | Implementation |
| 64 | Save the Prisoner! | Solution | Easy | 15 | Implementation |
| 65 | Circular Array Rotation | Solution | Easy | 20 | Implementation |
| 66 | Sequence Equation | Solution | Easy | 20 | Implementation |
| 67 | Jumping on the Clouds: Revisited | Solution | Easy | 15 | Implementation |
| 68 | Library Fine | Solution | Easy | 15 | Implementation |
| 69 | Cut the sticks | Solution | Easy | 25 | Implementation |
| 70 | Non-Divisible Subset | Solution | Medium | 20 | Implementation |
| 71 | Equalize the Array | Solution | Easy | 20 | Implementation |
| 72 | Queen's Attack II | Solution | Medium | 30 | Implementation |
| 73 | ACM ICPC Team | Solution | Easy | 25 | Implementation |
| 74 | Taum and B'day | Solution | Easy | 25 | Implementation |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Day 0: Mean, Median, and Mode | Solution | Easy | 30 | 10 Days of Statistics |
| 2 | Day 0: Weighted Mean | Solution | Easy | 30 | 10 Days of Statistics |
| 3 | Day 1: Quartiles | Solution | Easy | 30 | 10 Days of Statistics |
| 4 | Day 1: Interquartile Range | Solution | Easy | 30 | 10 Days of Statistics |
| 5 | Day 1: Standard Deviation | Solution | Easy | 30 | 10 Days of Statistics |
| 6 | Day 4: Binomial Distribution I | Solution | Easy | 30 | 10 Days of Statistics |
| 7 | Day 4: Binomial Distribution II | Solution | Easy | 30 | 10 Days of Statistics |
| 8 | Day 4: Geometric Distribution I | Solution | Easy | 30 | 10 Days of Statistics |
| 9 | Day 4: Geometric Distribution II | Solution | Easy | 30 | 10 Days of Statistics |
| 10 | Day 5: Poisson Distribution I | Solution | Easy | 30 | 10 Days of Statistics |
| 11 | Day 5: Poisson Distribution II | Solution | Easy | 30 | 10 Days of Statistics |
| 12 | Day 5: Normal Distribution I | Solution | Easy | 30 | 10 Days of Statistics |
| 13 | Day 5: Normal Distribution II | Solution | Easy | 30 | 10 Days of Statistics |
| 14 | Day 6: The Central Limit Theorem I | Solution | Easy | 30 | 10 Days of Statistics |
| 15 | Day 6: The Central Limit Theorem II | Solution | Easy | 30 | 10 Days of Statistics |
| 16 | Day 6: The Central Limit Theorem III | Solution | Easy | 30 | 10 Days of Statistics |
| 17 | Day 7: Pearson Correlation Coefficient I | Solution | Easy | 30 | 10 Days of Statistics |
| 18 | Day 0: Hello, World! | Solution | Easy | 10 | 10 Days of Javascript |
| 19 | Day 0: Data Types | Solution | Easy | 10 | 10 Days of Javascript |
| 29 | Day 1: Arithmetic Operators | Solution | Easy | 10 | 10 Days of Javascript |
| 30 | Day 1: Functions | Solution | Easy | 10 | 10 Days of Javascript |
| 31 | Day 1: Let and Const | Solution | Easy | 10 | 10 Days of Javascript |
| 32 | Day 2: Loops | Solution | Easy | 10 | 10 Days of Javascript |
| 33 | Day 2: Conditional Statements: If-Else | Solution | Easy | 10 | 10 Days of Javascript |
| 34 | Day 2: Conditional Statements: Switch | Solution | Easy | 10 | 10 Days of Javascript |
| 35 | Day 3: Arrays | Solution | Easy | 15 | 10 Days of Javascript |
| 36 | Day 3: Try, Catch, and Finally | Solution | Easy | 15 | 10 Days of Javascript |
| 37 | Day 3: Throw | Solution | Easy | 15 | 10 Days of Javascript |
| 38 | Day 4: Create a Rectangle Object | Solution | Easy | 15 | 10 Days of Javascript |
| 39 | Day 4: Count Objects | Solution | Easy | 15 | 10 Days of Javascript |
| 40 | Day 4: Classes | Solution | Easy | 15 | 10 Days of Javascript |
| 41 | Day 5: Inheritance | Solution | Easy | 15 | 10 Days of Javascript |
| 42 | Day 5: Template Literals | Solution | Easy | 15 | 10 Days of Javascript |
| 43 | Day 5: Arrow Functions | Solution | Easy | 15 | 10 Days of Javascript |
| 44 | Day 6: Bitwise Operators | Solution | Easy | 15 | 10 Days of Javascript |
| 45 | Day 6: JavaScript Dates | Solution | Easy | 15 | 10 Days of Javascript |
| 46 | Day 7: Regular Expressions I | Solution | Easy | 15 | 10 Days of Javascript |
| 47 | Day 7: Regular Expressions II | Solution | Easy | 15 | 10 Days of Javascript |
| 48 | Day 7: Regular Expressions III | Solution | Easy | 15 | 10 Days of Javascript |
| 49 | Day 7: Spearman's Rank Correlation Coefficient | Solution | Easy | 30 | 10 Days of Statistics |
| 50 | Day 8: Least Square Regression Line | Solution | Easy | 30 | 10 Days of Statistics |
| 51 | Day 9: Multiple Linear Regression | Solution | Medium | 30 | 10 Days of Statistics |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Find the Point | Solution | Easy | 5 | Fundamentals |
| 2 | Maximum Draws | Solution | Easy | 5 | Fundamentals |
| 3 | Handshake | Solution | Easy | 10 | Fundamentals |
| 4 | Minimum Height Triangle | Solution | Easy | 10 | Fundamentals |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Sock Merchant | Solution | Easy | 10 | Warm-up Challenges |
| 2 | Counting Valleys | Solution | Easy | 15 | Warm-up Challenges |
| 3 | Jumping on the Clouds | Solution | Easy | 20 | Warm-up Challenges |
| 4 | Repeated String | Solution | Easy | 20 | Warm-up Challenges |
| 5 | 2D Array - DS | Solution | Easy | 15 | Arrays |
| 6 | Array Manipulation | Solution | Hard | 60 | Arrays |
| 7 | Arrays: Left Rotation | Solution | Easy | 20 | Arrays |
| 8 | New Year Chaos | Solution | Medium | 40 | Arrays |
| 9 | Minimum Swaps 2 | Solution | Medium | 40 | Arrays |
| 10 | Hash Tables: Ransom Note | Solution | Easy | 25 | Dictionaries and Hashmaps |
| 11 | Hash Tables: Ransom Note | Solution | Easy | 25 | Dictionaries and Hashmaps |
| 12 | Sherlock and Anagrams | Solution | Medium | 50 | Dictionaries and Hashmaps |
| 13 | Count Triplets | Solution | Medium | 35 | Dictionaries and Hashmaps |
| 14 | Frequency Queries | Solution | Medium | 40 | Dictionaries and Hashmaps |
| 15 | Mark and Toys | Solution | Easy | 35 | Sorting |
| 16 | Sorting: Bubble Sort | Solution | Easy | 30 | Sorting |
| 17 | Sorting: Comparator | Solution | Medium | 35 | Sorting |
| 18 | Fraudulent Activity Notifications | Solution | Medium | 40 | Sorting |
| 19 | Merge Sort: Counting Inversions | Solution | Hard | 45 | Sorting |
| 20 | Strings: Making Anagrams | Solution | Easy | 25 | String Manipulation |
| 21 | Alternating Characters | Solution | Easy | 20 | String Manipulation |
| 22 | Sherlock and the Valid String | Solution | Medium | 35 | String Manipulation |
| 23 | Special String Again | Solution | Medium | 40 | String Manipulation |
| 24 | Common Child | Solution | Medium | 60 | String Manipulation |
| 25 | Minimum Absolute Difference in an Array | Solution | Easy | 15 | Greedy Algorithms |
| 26 | Luck Balance | Solution | Easy | 20 | Greedy Algorithms |
| 27 | Greedy Florist | Solution | Medium | 35 | Greedy Algorithms |
| 28 | Max Min | Solution | Medium | 35 | Greedy Algorithms |
| 29 | Hash Tables: Ice Cream Parlor | Solution | Medium | 35 | Search |
| 30 | Pairs | Solution | Medium | 50 | Search |
| 31 | Triple sum | Solution | Medium | 40 | Search |
| 32 | Minimum Time Required | Solution | Medium | 35 | Search |
| 33 | Maximum Subarray Sum | Solution | Hard | 65 | Search |
| 34 | Recursion: Fibonacci Numbers | Solution | Easy | 15 | Recursion and Backtracking |
| 35 | Recursion: Davis' Staircase | Solution | Medium | 30 | Recursion and Backtracking |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Say "Hello, World!" With C++ | Solution | Easy | 5 | Introduction |
| 2 | Input and Output | Solution | Easy | 5 | Introduction |
| 3 | Basic Data Types | Solution | Easy | 10 | Introduction |
| 4 | Conditional Statements | Solution | Easy | 10 | Introduction |
| 5 | For Loop | Solution | Easy | 10 | Introduction |
| 6 | Functions | Solution | Easy | 10 | Introduction |
| 7 | Pointer | Solution | Easy | 10 | Introduction |
| 8 | Array Introduction | Solution | Easy | 10 | Introduction |
| 9 | Variable Sized Arrays | Solution | Easy | 30 | Introduction |
| 10 | Hotel Prices | Solution | Medium | 15 | Debugging |
| 11 | Cpp exception handling | Solution | Medium | 20 | Debugging |
| 12 | Overloading Ostream Operator | Solution | Medium | 20 | Debugging |
| 13 | Messages Order | Solution | Medium | 40 | Debugging |
| 14 | StringStream | Solution | Easy | 10 | Strings |
| 15 | Strings | Solution | Easy | 10 | Strings |
| 16 | Structs | Solution | Easy | 10 | Classes |
| 17 | Class | Solution | Easy | 10 | Classes |
| 18 | Classes and Objects | Solution | Easy | 20 | Classes |
| # | Problem | Solution | Difficulty | Max Score | Sub domain |
|---|---|---|---|---|---|
| 1 | Bot saves princess | Solution | Easy | 13.90 | Bot Building |
| 2 | Bot saves princess - 2 | Solution | Easy | 17.50 | Bot Building |
| 3 | Bot Clean | Solution | Easy | 17.82 | Bot Building |
| 4 | Bot Clean Stochastic | Solution | Easy | 10.00 | Bot Building |
| 5 | BotClean Large | Solution | Hard | 54.00 | Bot Building |
| 6 | BotClean Partially Observable | Solution | Hard | 28.00 | Bot Building |
| 7 | PacMan - DFS | Solution | Easy | 15.00 | A* Search |
If you are interested in helping or have a solution in a different language feel free to make a pull request. You can also reach me on through the following media if you want to talk.
- Email - [email protected]
- Let's connect on LinkedIn
- I'm on HackerRank as well
