Page 2
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
HackerRank Algorithms Solutions
This repository contains solutions to the
Algorithms Domain part of HackerRank.
The Algorithms Domain Falls under a broader Problem Solving Skill Set in HackerRank
which consists of both
Data Structures
and Algorithms.
The Algorithms Domain is further Divided into the following sub-domains.
To Contribute have a look at
Contributing.md
and happy coding 😀 🐱💻.
Sub Domains & Problems [+Solutions] in the Algorithms Domain
⚡ Quick Links:
Warm up |
Implementation |
Strings |
Sorting |
Search |
Graph Theory |
Greedy |
Dynamic Programming |
Constructive Algorithms |
Bit Manipulation |
Recursion |
Game Theory |
NP Complete |
Debugging
Warmup
Problem
Difficulty
Solution Link
Solve Me First |
Easy |
|
Simple Array Sum |
Easy |
|
Compare The Triplets |
Easy |
|
A very Big Sum |
Easy |
|
Diagonal Difference |
Easy |
|
Plus Minus |
Easy |
|
Staircase |
Easy |
|
Mini-Max Sum |
Easy |
|
Birthday Cake Candles |
Easy |
|
Time Conversion |
Easy |
|
Implementation
Problem
Difficulty
Solution Link
Grading Students |
Easy |
|
Apple and Orange |
Easy |
|
Kangaroo |
Easy |
|
Between Two Sets |
Easy |
|
Breaking The Records |
Easy |
|
Birthday Chocolate |
Easy |
|
Divisible Sum Pairs |
Easy |
|
Migratory Birds |
Easy |
|
Day of the Programmer |
Easy |
|
Bon Appétit |
Easy |
|
Sock Merchant |
Easy |
|
Drawing Book |
Easy |
|
Counting Valleys |
Easy |
|
Electronics Shop |
Easy |
|
Cats and a Mouse |
Easy |
|
Forming a Magic Square |
Medium |
|
Picking Numbers |
Easy |
|
Climbing The Leaderboard |
Medium |
|
The Hurdle Race |
Easy |
|
Designer PDF Viewer |
Easy |
|
Utopian Tree |
Easy |
|
Angry Professor |
Easy |
|
Beautiful Days at the movies |
Easy |
|
Viral Advertising |
Easy |
|
Save The Prisoner |
Easy |
|
Circular Array Rotation |
Easy |
|
Sequence Equation |
Easy |
|
Jumping On the Clouds Revisited |
Easy |
|
Find Digits |
Easy |
|
Extra Long factorials |
Medium |
|
Append and Delete |
Easy |
|
Sherlock and Squares |
Easy |
|
Library Fine |
Easy |
|
Cut the Sticks |
Easy |
|
Non-Divisible Subset |
Medium |
|
Repeated String |
Easy |
|
Jumping on The Clouds |
Easy |
|
Equalize The Array |
Easy |
|
Queen's Attack II |
Medium |
|
ACM ICPC Team |
Easy |
|
Taum and B'Dday |
Easy |
|
Organizing Containers of Balls |
Medium |
|
Encryption |
Medium |
|
Modified Kaprekar numbers |
Easy |
|
Beautiful Triplets |
Easy |
|
Minimum Distances |
Easy |
|
Halloween Sales |
Easy |
|
The Time in Words |
Medium |
|
Chocolate Feast |
Easy |
|
Service Lane |
Easy |
|
Lisa's Workbook |
Easy |
|
Flatland Space Stations |
Easy |
|
Fair Rations |
Easy |
|
Cavity Map |
Easy |
|
Manasa and Stones |
Easy |
|
The Grid Search |
Medium |
|
Happy Ladybugs |
Easy |
|
Strange Counter |
Easy |
|
3D Surface Area |
Medium |
|
Absolute Permutations |
Medium |
|
The Bomberman Game |
Medium |
|
Emma's Supercomputer |
Medium |
|
Larry's Array |
Medium |
|
Almost Sorted |
Medium |
|
Matrix Layer Rotation |
Hard |
|
Bigger is Greater |
Medium |
|
Strings
Problem
Difficulty
Solution Link
Strong Password |
Easy |
|
Super Reduced String |
Easy |
|
CamelCase |
Easy |
|
Two Characters |
Easy |
|
Caeser Cipher |
Easy |
|
Mars Exploration |
Easy |
|
HackerRank In a String! |
Easy |
|
Pangrams |
Easy |
|
Weighted Uniform Strings |
Easy |
|
Separate The Numbers |
Easy |
|
Funny String |
Easy |
|
Gemstones |
Easy |
|
Alternating Characters |
Easy |
|
Beautiful Binary String |
Easy |
|
The Love-Letter Mysetry |
Easy |
|
Palindromic Index |
Easy |
|
Anagram |
Easy |
|
Making Anagrams |
Easy |
|
Game of Thrones - I |
Easy |
|
Two Strings |
Easy |
|
String Construction |
Easy |
|
Highest Value Palindrome |
Medium |
|
Sherlock and The Valid String |
Medium |
|
Maximum Palindromes |
Medium |
|
Sherlock and Anagrams |
Medium |
|
Common Child |
Medium |
|
Bear and Steady Gene |
Medium |
|
Determining DNA Health |
Hard |
|
Morgan and String |
Expert |
|
Count Strings |
Hard |
|
String Function Calculation |
Advanced |
|
Build a Palindrome |
Advanced |
|
Build a String |
Hard |
|
Gridland Provinces |
Hard |
|
Cards Permutations |
Expert |
|
Ashton and String |
Advanced |
|
String Similarity |
Expert |
|
Super Functional Strings |
Advanced |
|
Circular Palindromes |
Advanced |
|
Similar Strings |
Advanced |
|
Save Humanity |
Expert |
|
Find Strings |
Expert |
|
Palindromic Border |
Expert |
|
Two Two |
Advanced |
|
Two String Game |
Expert |
|
Letter Islands |
Expert |
|
Pseudo-Isomorphic Substrings |
Expert |
|
How many Substrings? |
Expert |
|
Sorting
Problem
Difficulty
Solution Link
Insertion Sort - Part 1 |
Easy |
|
Insertion Sort - Part 2 |
Easy |
|
Running Time of Algorithms |
Easy |
|
Quicksort 1 - Partition |
Easy |
|
Fraudulent Activity Notifications |
Medium |
|
Lily's Homework |
Medium |
|
Insertion Sort Advanced Analysis |
Advanced |
|
Search
Problem
Difficulty
Solution Link
Missing Numbers |
Easy |
|
Hackerland Radio Transmitters |
Medium |
|
Gridland Metro |
Medium |
|
KnightL On ChessBoard |
Medium |
|
Minimum Loss |
Medium |
|
Short Palindrome |
Medium |
|
Count Luck |
Medium |
|
Cut The Tree |
Medium |
|
Gena Playing Hanoi |
Medium |
|
Beautiful Quadruples |
Medium |
|
Red Knight's Shortest Path |
Medium |
|
Maximizing Mission Points |
Hard |
|
Making Candies |
Hard |
|
Bike Racers |
Hard |
|
Task Scheduling |
Hard |
|
Similar Pair |
Hard |
|
Absolute Element Sum |
Hard |
|
Almost Integer Rock Garden |
Hard |
|
Sorted Subsegments |
Hard |
|
Distant Pairs |
Hard |
|
Knight Richard's Knights |
Hard |
|
Graph Theory
Problem
Difficulty
Solution Link
Journey To The Moon |
Medium |
|
Synchronous Shopping |
Medium |
|
Breadth First Search: Shortest Reach |
Medium |
|
Kruskal [MST]: Really Special Subtree |
Medium |
|
Even Tree |
Medium |
|
Snakes and Ladders: The Quickest Way Up |
Medium |
|
The Story Of A Tree |
Medium |
|
Prim's [MST]: Special Subtree |
Medium |
|
Clique |
Medium |
|
Minimum Penalty Path |
Medium |
|
Jack Goes To Rapture |
Medium |
|
Crab Graphs |
Medium |
|
Jeanie's Route |
Medium |
|
Roads in HackerLand |
Medium |
|
Rust & Murderer |
Medium |
|
Frog And Maze |
Hard |
|
Subset Component |
Hard |
|
Dijkstra: Shortest Reach 2 |
Hard |
|
Toll Cost Digits |
Hard |
|
Real Estate Broker |
Hard |
|
Demanding Money |
Hard |
|
The Value Of Friendship |
Hard |
|
Coprime Paths |
Expert |
|
Minimum MST Graph |
Expert |
|
Bread Ornaments |
Advanced |
|
Floyd: City Of Blinding Lights |
Hard |
|
Kingdom Connectivity |
Hard |
|
Computer Game |
Hard |
|
Problem Solving |
Hard |
|
Journey Scheduling |
Hard |
|
Recording Episodes |
Hard |
|
Repair Roads |
Hard |
|
Kth Ancestor |
Hard |
|
ByteLandian Tours |
Hard |
|
Find The Path |
Hard |
|
Savita & Friends |
Hard |
|
Liars |
Advanced |
|
Jumping Rocks |
Advanced |
|
Tripartite Matching |
Hard |
|
Tree Flow |
Hard |
|
DAG Queries |
Expert |
|
Favorite Sequence |
Advanced |
|
Jogging Cats |
Advanced |
|
Quadrant Queries |
Advanced |
|
Hacker Country |
Hard |
|
HackerX |
Hard |
|
Huarongdao |
Expert |
|
Training The Army |
Hard |
|
Jim and His LAN Party |
Hard |
|
Travel in HackerLand |
Hard |
|
Alex vs Fedor |
Expert |
|
Vertical Paths |
Expert |
|
Drive |
Expert |
|
Travelling Salesman In A Grid |
Expert |
|
Road Network |
Expert |
|
Going To The Office |
Expert |
|
Tree Splitting |
Advanced |
|
Ticket |
Expert |
|
DFS Edges |
Expert |
|
Diameter Minimization |
Expert |
|
Airports |
Expert |
|
Definite Random Walks |
Expert |
|
Greedy
Problem
Difficulty
Solution Link
Minimum Absolute Difference In Array |
Easy |
|
Marc's Cakewalk |
Easy |
|
Grid Challenge |
Easy |
|
Luck Balance |
Easy |
|
Maximum Perimeter Triangle |
Easy |
|
Beautiful Pairs |
Easy |
|
Sherlock and The Beast |
Easy |
|
Priyanka and Toys |
Easy |
|
Largest Permutation |
Easy |
|
Mark and Toys |
Easy |
|
Jim and The Orders |
Easy |
|
Permuting Two Arrays |
Easy |
|
Candies |
Medium |
|
Greedy Florist |
Medium |
|
Max Min |
Medium |
|
Cloudy Day |
Medium |
|
Cutting Boards |
Hard |
|
Chief Hopper |
Hard |
|
Sherlock and MinMax |
Hard |
|
Accessory Collection |
Hard |
|
Fighting Pits |
Hard |
|
Reverse Shuffle Merge |
Advanced |
|
Team Formation |
Advanced |
|
Dynamic Programming
Problem
Difficulty
Solution Link
The Coin Change Problem |
Medium |
|
Equal |
Medium |
|
Sherlock and Cost |
Medium |
|
Construct The Array |
Medium |
|
Kingdom Division |
Medium |
|
Sam and Substrings |
Medium |
|
Fibonacci Modified |
Medium |
|
Abbreviation |
Medium |
|
Prime XOR |
Medium |
|
Fair Cut |
Medium |
|
The Maximum Subarray |
Medium |
|
Prime Digit Sum |
Medium |
|
HackerRank City |
Medium |
|
Summing Pieces |
Medium |
|
Mr K Marsh |
Medium |
|
Substring Diff |
Medium |
|
Xor and Sum |
Medium |
|
Lego Blocks |
Medium |
|
Stock Maximize |
Medium |
|
Two Robots |
Medium |
|
Cut Tree |
Medium |
|
Wet Shark and Two Subsequences |
Medium |
|
Nikita and the Game |
Medium |
|
Mandragora Forest |
Medium |
|
Red John is Back |
Medium |
|
LCS Returns |
Medium |
|
Grid Walking |
Medium |
|
Knapsack |
Medium |
|
Bricks Game |
Medium |
|
Coin On The Table |
Medium |
|
The Longest Common Subsequence |
Medium |
|
Play With Words |
Medium |
|
Counting Special Sub-Cubes |
Medium |
|
Interval Selection |
Medium |
|
The Indian Job |
Medium |
|
Travel Around The World |
Medium |
|
Candles Counting |
Medium |
|
Swap Permutation |
Medium |
|
Extremum Permutations |
Medium |
|
Decibinary Numbers |
Hard |
|
Angry Children 2 |
Hard |
|
Sherlock's Array Merging Problem |
Hard |
|
Brick Tilling |
Hard |
|
Alien Language |
Hard |
|
Tara's Beautiful Permutations |
Hard |
|
Choosing White Balls |
Hard |
|
Matrix Land |
Hard |
|
Black and White Tree |
Hard |
|
String Reduction |
Hard |
|
Far Vertices |
Hard |
|
Superman Celebrates Diwali |
Hard |
|
Hexagonal Grid |
Hard |
|
Queens On Board |
Hard |
|
Turn of The Lights |
Hard |
|
Animal Transport |
Hard |
|
A Super Hero |
Hard |
|
Clues On Binary Path |
Hard |
|
Road Maintenance |
Hard |
|
Beautiful Strings |
Hard |
|
Covering The Stains |
Hard |
|
GCD Matrix |
Hard |
|
New Year Present |
Hard |
|
Longest Palindromic Subsequence |
Hard |
|
Square Subsequences |
Hard |
|
Police Operation |
Hard |
|
Zurikela's Graph |
Hard |
|
Longest Mod Path |
Hard |
|
P-Sequences |
Hard |
|
Oil Well |
Hard |
|
The Blacklist |
Hard |
|
Ones and Twos |
Hard |
|
Unique Divide and Conquer |
Advanced |
|
Dortmund Dilemma |
Advanced |
|
Super Kth LIS |
Advanced |
|
Points In Plane |
Advanced |
|
Fairy Chess |
Advanced |
|
Mining |
Advanced |
|
Requirement |
Advanced |
|
Robot |
Advanced |
|
Unfair Game |
Advanced |
|
Modify The Sequence |
Advanced |
|
Vim War |
Advanced |
|
Best Spot |
Advanced |
|
Hyper Strings |
Advanced |
|
Tree Pruning |
Advanced |
|
Dorsey Thief |
Advanced |
|
Find The Seed |
Advanced |
|
Billboards |
Advanced |
|
Shashank and Palindromic Strings |
Advanced |
|
The Longest Increasing Subsequence |
Advanced |
|
Counting The Ways |
Expert |
|
Hard Disk Drives |
Expert |
|
Separate The Chocolate |
Expert |
|
King and Four Sons |
Expert |
|
Divisible Numbers |
Expert |
|
Counting Road Networks |
Expert |
|
Count Scorecards |
Expert |
|
Suffix Rotation |
Expert |
|
Lucky Numbers |
Expert |
|
Constructive Algorithms
Problem
Difficulty
Solution Link
Lena Sort |
Medium |
|
Flipping The Matrix |
Medium |
|
Gaming Array |
Medium |
|
New Year Chaos |
Medium |
|
Bonetrousle |
Medium |
|
Yet Another KMP Problem |
Hard |
|
Beautiful 3 Set |
Hard |
|
Inverse RMQ |
Hard |
|
Lovely Triplets |
Advanced |
|
Array Construction |
Advanced |
|
Two Subarrays |
Expert |
|
Bit Manipulation
Problem
Difficulty
Solution Link
Lonely Integer |
Easy |
|
Maximizing XOR |
Easy |
|
Sum vs XOR |
Easy |
|
Flipping Bits |
Easy |
|
Counter Game |
Medium |
|
Xor-sequence |
Medium |
|
The Great XOR |
Medium |
|
Yet Another Minimax Problem |
Medium |
|
Sansa and XOR |
Medium |
|
AND Product |
Medium |
|
Winning Lottery Ticket |
Medium |
|
Cipher |
Medium |
|
What's Next? |
Medium |
|
A or B |
Medium |
|
Xoring Ninja |
Hard |
|
XOR Matrix |
Hard |
|
String Transmission |
Hard |
|
Manipulative Numbers |
Hard |
|
Stone Game |
Hard |
|
Mixing Proteins |
Hard |
|
Maximizing The Function |
Hard |
|
2's Complement |
Advanced |
|
Changing Bits |
Advanced |
|
XOR Key |
Advanced |
|
XOR Subsequences |
Advanced |
|
Iterate It |
Expert |
|
Hamming Distance |
Expert |
|
Recursion
Problem
Difficulty
Solution Link
The Power Sum |
Medium |
|
Crossword Puzzle |
Medium |
|
Recursive Digit Sum |
Medium |
|
Simplified Chess Engine |
Medium |
|
Password Cracker |
Medium |
|
Stone Division, Revisited |
Medium |
|
Arithmetic Expressions |
Hard |
|
K Factorization |
Hard |
|
Bowling Pins |
Hard |
|
Simplified Chess Engine II |
Hard |
|
Repitive K-Sums |
Advanced |
|
Game Theory
Problem
Difficulty
Solution Link
Game Of Stones |
Easy |
|
Tower Breaker |
Easy |
|
A Chessboard Game |
Easy |
|
Introduction To Nim Game |
Easy |
|
Misère Nim |
Easy |
|
Nimble Game |
Easy |
|
Poker Nim |
Easy |
|
Alice and Bob's Silly Game |
Medium |
|
Tower Breakers, Revisited! |
Medium |
|
Tower Breakers, Again! |
Medium |
|
Zero Move Nim |
Medium |
|
Chessboard Game Again |
Medium |
|
Digits Square Board |
Medium |
|
Fun Game |
Medium |
|
Chocolate In Box |
Medium |
|
Kitty and Katty |
Medium |
|
Powers Game |
Medium |
|
Deforestation |
Medium |
|
Bob and Ben |
Medium |
|
Tower Breakers - The Final Battle |
Medium |
|
Permutation Game |
Medium |
|
Play on Benders |
Medium |
|
New Year Game |
Medium |
|
Vertical Rooks |
Medium |
|
A Stone Game |
Medium |
|
Stone Division |
Hard |
|
Simple Game |
Hard |
|
Move The Coins |
Hard |
|
Stone Piles |
Hard |
|
Chocolate Game |
Hard |
|
The Prime Game |
Hard |
|
Tastes Like Winning |
Expert |
|
NP Complete
Problem
Difficulty
Solution Link
Walking The Approximate Longest Path |
Hard |
|
Sam's Puzzle [Approximate] |
Advanced |
|
Spies, Revised |
Expert |
|
TBS Problem |
Expert |
|
Debugging
Problem
Difficulty
Solution Link
XOR Strings |
Easy |
|
Smart Number |
Easy |
|
Prime Dates |
Medium |
|
Minimum Operations |
Medium |
|
Zig Zag Sequence |
Medium |
|
Video liên quan