A collection of solutions and explanations of Hackerrank.com problems in many languages.
Solved problems of HackerRank. www.hackerrank.com
To see every contributors, please reference at here.
https://www.hackerrank.com/domains/tutorials/cracking-the-coding-interview
Data Structures
Problem | Python3 | C++ | PHP |
---|---|---|---|
Arrays: Left Rotation | ✓ | ✓ | |
Strings: Making Anagrams | ✓ | ||
Hash Tables: Ransom Note | ✓ | ||
Linked Lists: Detect a Cycle | ✓ | ||
Stacks: Balanced Brackets | ✓ | ||
Queues: A Tale of Two Stacks | ✓ | ||
Tries: Contacts | ✓ |
Algorithms
Problem | Python3 | C++ | PHP |
---|---|---|---|
Sorting: Bubble Sort | ✓ | ||
Sorting: Comparator | ✓ | ||
Hash Tables: Ice Cream Parlor | ✓ | ||
DFS: Connected Cell in a Grid | ✓ | ||
Minimum Swaps 2 | ✓ |
Techniques/Concepts
Problem | Python3 | C++ | PHP |
---|---|---|---|
Time Complexity: Primality | ✓ | ||
Recursion: Fibonacci Numbers | ✓ | ||
Recursion: Davis' Staircase | ✓ | ||
DP: Coin Change | ✓ | ||
Bit Manipulation: Lonely Integer | ✓ |
https://www.hackerrank.com/contests/code-and-the-curious/challenges
Problem | Python3 | C++ | PHP |
---|---|---|---|
Sell Statistics Query System | ✓ |
Problem | Python3 | C++ | PHP |
---|---|---|---|
The Average Rating of Top Employees | ✓ | ||
Simple Language | ✓ |
Warmup
Problem | Python3 | C++ | PHP |
---|---|---|---|
Solve Me First | ✓ | ✓ | |
Simple Array Sum | ✓ | ✓ | |
Compare the Triplets | ✓ | ✓ | |
A Very Big Sum | ✓ | ✓ | |
Diagonal Difference | ✓ | ||
Plus Minus | ✓ | ✓ | |
Staircase | ✓ | ✓ | |
Mini-Max Sum | ✓ | ✓ | |
Birthday Cake Candles | ✓ | ✓ | |
Time Conversion | ✓ | ✓ | ✓ |
Implementation
Problem | Python3 | C++ | PHP |
---|---|---|---|
Grading Students | ✓ | ✓ | |
Apple and Orange | ✓ | ||
Kangaroo | ✓ | ||
Between Two Sets | ✓ | ||
Breaking the Records | ✓ | ||
Birthday Chocolate | ✓ | ||
Divisible Sum Pairs | ✓ | ||
Migratory Birds | ✓ | ||
Day of the Programmer | ✓ | ||
Bon Appétit | ✓ | ||
Sock Merchant | ✓ | ||
Drawing Book | ✓ | ||
Counting Valleys | ✓ | ||
Electronics Shop | ✓ | ||
Cats and a Mouse | ✓ | ||
Picking Numbers | ✓ | ||
Climbing the Leaderboard | ✓ | ||
The Hurdle Race | ✓ | ||
Designer PDF Viewer | ✓ | ||
Utopian Tree | ✓ | ||
Jumping on the Clouds: Revisited | ✓ | ||
Find Digits | ✓ | ||
Extra Long Factorials | ✓ | ||
Jumping on the Clouds | ✓ | ||
Minimum Distances | ✓ | ||
The Grid Search | ✓ | ||
Absolute Permutation | ✓ |
Strings
Problem | Python3 | C++ | PHP | Go |
---|---|---|---|---|
Super Reduced String | ✓ | |||
CamelCase | ✓ | ✓ | ||
Strong Password | ✓ | |||
Two Characters | ✓ | |||
Caesar Cipher | ✓ | |||
Mars Exploration | ✓ | |||
HackerRank in a String! | ✓ | |||
Pangrams | ✓ | ✓ | ||
Alternating Characters | ✓ | |||
String Construction | ✓ | |||
Ashton and String | ✓ | |||
Two Strings | ✓ | ✓ | ✓ |
Sorting
Problem | Python3 | C++ | PHP |
---|---|---|---|
Big Sorting | ✓ | ||
Intro to Tutorial Challenges | ✓ | ||
Insertion Sort - Part 1 | ✓ | ||
Counting Sort 1 | ✓ |
Searching
Problem | Python3 | C++ | PHP |
---|---|---|---|
Ice Cream Parlor | ✓ |
Graph Theory
Problem | Python3 | C++ | PHP |
---|---|---|---|
Journey to the Moon | ✓ |
Greedy
Problem | Python3 | C++ | PHP |
---|---|---|---|
Marc's Cakewalk | ✓ |
Dynamic Programming
Problem | Python3 | C++ | PHP |
---|---|---|---|
The Maximum Subarray | ✓ |
Bit Manipulation
Problem | Python3 | C++ | PHP |
---|---|---|---|
Lonely Integer | ✓ | ||
Maximizing XOR | ✓ | ||
Flipping bits | ✓ |
Arrays
Problem | Python3 | C++ | PHP |
---|---|---|---|
Arrays - DS | ✓ | ||
2D Array - DS | ✓ | ||
Left Rotation | ✓ | ||
Is This a Binary Search Tree? | ✓ |
Linked Lists
Problem | Python3 | C++ | PHP |
---|---|---|---|
Reverse a doubly linked list | ✓ |
Introduction
Problem | Clojure |
---|---|
Solve Me First FP | ✓ |
Hello World | ✓ |
Hello World N Times | ✓ |
List Replication | ✓ |
Filter Array | ✓ |
Filter Positions in a List | ✓ |
Array Of N Elements | ✓ |
Reverse a List | ✓ |
Sum of Odd Elements | ✓ |
List Length | ✓ |
Update List | ✓ |
Evaluating e^x | ✓ |
Basic Select
Problem | MySQL |
---|---|
Revising the Select Query I | ✓ |
Revising the Select Query II | ✓ |
Select All | ✓ |
Select By ID | ✓ |
Japanese Cities' Attributes | ✓ |
Japanese Cities' Names | ✓ |
Weather Observation Station 1 | ✓ |
Weather Observation Station 3 | ✓ |
Weather Observation Station 4 | ✓ |
Weather Observation Station 5 | ✓ |
Weather Observation Station 6 | ✓ |
Weather Observation Station 7 | ✓ |
Weather Observation Station 8 | ✓ |
Weather Observation Station 9 | ✓ |
Weather Observation Station 10 | ✓ |
Weather Observation Station 11 | ✓ |
Weather Observation Station 12 | ✓ |
Higher Than 75 Marks | ✓ |
Employee Names | ✓ |
Employee Salaries | ✓ |