My solutions to problems on HackerRank
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
30 Days of Code
Python
algorithms
datastructures
weekof27
.gitignore
LICENSE
README.md
_config.yml
boilerplate.go

README.md


My solutions to HackerRank problems

Solutions are coded using Python3, Go

10 Days of Statistics

Day Challenge Points Solution
0 Mean, Median, and Mode 30
0 Weighted Mean 30
1 Quartiles 30
1 Interquartile Range 30
1 Standard Deviation 30
2 Basic Probability 10
2 More Dice 10
2 Compound Event Probability 10
3 Conditional Probability 10
3 Cards of the Same Suit 10
3 Drawing Marbles 10
4 Binomial Distribution I 30
4 Binomial Distribution II 30
4 Geometric Distribution I 30
4 Geometric Distribution II 30
5 Poisson Distribution I 30
5 Poisson Distribution II 30
5 Normal Distribution I 30
5 Normal Distribution II 30
6 The Central Limit Theorem I 30
6 The Central Limit Theorem II 30
6 The Central Limit Theorem III 30
7 Pearson Correlation Coefficient I 30
7 Spearman's Rank Correlation Coefficient 30
8 Least Square Regression Line 30
8 Pearson Correlation Coefficient II 30
9 Multiple Linear Regression 30

30 Days of Code

Day Challenge Points Solution
0 Hello, World 30 main.go
1 Data Types 30 main.go
2 Operators 30 main.go
3 Intro to Conditional Statements 30 main.go
4 Class vs. Instance 30 main.go
5 Loops 30 main.go
6 Let's Review 30 main.go
7 Arrays 30 main.go
8 Dictionaries and Maps 30 main.go
9 Recursion 30 main.go
10 Binary Numbers 30 main.go
11 2D Arrays 30 main.go
12 Inheritance 30 main.go
13 Abstract Classes 30 main.go
14 Scope 30 main.go
15 Linked List 30 main.go
16 Exceptions - String to Integer 30 main.go
17 More Exceptions 30 main.go
18 Queues and Stacks 30 main.go
19 Interfaces 30 main.go
20 Sorting 30 main.go
21 Generics 30 main.go
22 Binary Search Trees 30 main.go
23 BST Level-Order Traversal 30 main.go
24 More Linked Lists 30 main.go
25 Running Time and Complexity 30 main.go
26 Nested Logic 30 main.go
27 Testing 30 main.go

Python

Subdomain Challenge Points Solution
Introduction Hello, World 5 solution.py
Introduction If-Else 10 solution.py
Introduction Arithmetic Operators 10 solution.py
Introduction Division 10 solution.py
Introduction Loops 10 solution.py
Introduction Function 10 solution.py
Introduction Print Function 20 solution.py
Basic Data Types Lists 10 solution.py
Basic Data Types Tuples 10 solution.py
Basic Data Types List Comprehensions 10 solution.py
Basic Data Types Find the Runner-Up Score! 10 solution.py
Basic Data Types Nested Loops 10 solution.py
Basic Data Types Percentage 10 solution.py
Strings sWAP cASE 10 solution.py
Strings String Split and Join 10 solution.py
Strings What's Your Name? 10 solution.py
Strings Mutations 10 solution.py
Strings Find a string 10 solution.py
Strings String Validators 10 solution.py
Strings Text Alignment 10 solution.py
Strings Text Wrap 10 solution.py
Strings Designer Door Mat 10 solution.py
Strings String Formatting 10 solution.py
Sets Introduction to Sets 10 solution.py
Sets Symmetric Difference 10 solution.py
Sets No Idea 50 solution.py
Sets Set.add() 10 solution.py
Sets Set .discard(), .remove() & .pop() 10 solution.py
Sets Set .union() Operation 10 solution.py
Sets Set .intersection() Operation 10 solution.py
Sets Set .difference() Operation 10 solution.py
Sets Set .symmetric_difference() Operation 10 solution.py
Sets Set Mutations 10 solution.py
Sets The Captain's Room 10 solution.py
Sets Check Subset 10 solution.py
Sets Check Strict Superset 10 solution.py

Algorithms

Subdomain Challenge Points Solution
Sorting Quicksort 1 - Partition 10
Sorting Marc's Cakewalk 15
Sorting Minimum Absolute Difference in an Array 15
Sorting Luck Balance 20
Sorting Insertion Sort - Part 1 30
Sorting Insertion Sort - Part 2 30
Sorting Correctness and the Loop Invariant 30
Sorting Running Time of Algorithms 30
Sorting Quicksort 2 - Sorting 30
Sorting Counting Sort 1 30
Sorting Counting Sort 2 30
Sorting Counting Sort 3 30
Sorting Intro to Tutorial Challenges 30
Sorting Quicksort In-Place 35
Sorting Running Time of Quicksort 35
Sorting The Full Counting Sort 40
Search Ice Cream Parlor 30
Search Connected Cells in a Grid 50
Greedy Grid Challenge 20
Greedy Maximum Perimeter Triangle 20
Greedy Beautiful Pairs 30
Graph Theory Breadth First Search - Shortest Reach 55
Strings Super Reduced String 10
Strings CamelCase 15
Strings Two Characters 15
Strings Caesar Cipher 15
Strings Mars Exploration 15
Strings Weighted Uniform Strings 20
Strings Gemstones 20
Strings Alternating Characters 20
Strings Beautiful Binary String 20
Strings The Love-Letter Mystery 20
Strings String Construction 25
Dynamic Programming The Coin Change Problem 60
Bit Manipulation Lonely Integer 20
Bit Manipulation Bit Manipulation: Lonely Integer 20
Bit Manipulation Sum vs XOR 25
Bit Manipulation Maximizing XOR 30
Bit Manipulation Sansa and XOR 30
Bit Manipulation Counter game 30

Cracking the Coding Interview

Topic Challenge Points Solution
Techniques / Concepts Time Complexity: Primality 15
Techniques / Concepts Recursion: Fibonacci Numbers 20
Techniques / Concepts Recursion: Davis' Staircase 30
Techniques / Concepts DP: Coin Change 30
Techniques / Concepts Bit Manipulation: Lonely Integer 60
Data Structures Arrays: Left Rotation 20
Data Structures Strings: Making Anagrams 25
Data Structures Hash Tables: Ransom Note 25
Data Structures Linked Lists: Detect a Cycle 25
Data Structures Stacks: Balanced Brackets 30
Data Structures Queues: A Tale of Two Stacks 30
Data Structures Trees: Is This a Binary Search Tree? 30
Data Structures Heaps: Find the Running Median 50
Data Structures Tries: Contacts 50
Algorithms Sorting: Bubble Sort 30
Algorithms Sorting: Comparator 35
Algorithms Merge Sort: Counting Inversions 35
Algorithms Binary Search: Ice Cream Parlor 45
Algorithms DFS: Connected Cell in a Grid 45
Algorithms BFS: Shortest Reach in a Graph 45

Data Structures

Subdomain Challenge Points Solution
Arrays Arrays - DS 10
Arrays 2D Array - DS 15
Arrays Dynamic Array 15
Arrays Left Rotation 20
Arrays Sparse Arrays 25
Arrays Algorithmic Crush 60
Stacks Maximum Element 20
Stacks Balanced Brackets 25
Trees Tree: Preorder Traversal 10
Trees Tree: Inorder Traversal 10
Trees Tree: Postorder Traversal 10
Trees Tree: Height of a Binary Tree 10
Trees Tree: Level Order Traversal 20
Trees Tree: Huffman Decoding 20
Trees Tree: Top View 20
Trees Binary Search Tree: Insertion 20
Trees Binary Search Tree: Lowest Common Ancestor 30
Trees Is This a Binary Search Tree? 30
Trees Swap Nodes [Algo] 40
Trees Square-Ten Tree 60
Linked List Print the Elements of a Linked List 5
Linked List Insert a node at the head of a linked list 5
Linked List Insert a Node at the Tail of a Linked List 5
Linked List Insert a node at a specific position in a linked list 5
Linked List Delete a Node 5
Linked List Print in Reverse 5
Linked List Reverse a linked list 5
Linked List Compare two linked lists 5
Linked List Merge two sorted linked lists 5
Linked List Get Node Value 5
Linked List Delete duplicate-value nodes from a sorted linked list 5
Linked List Cycle Detection 5
Linked List Find Merge Point of Two Lists 5
Linked List Inserting a Node Into a Sorted Doubly Linked List 5
Linked List Reverse a doubly linked list 5
Tries Contacts 40
Queues Queue using Two Stacks 30
Heaps Find the Running Median 50
Multiple Choice Data Structures MCQ 1 5
Multiple Choice Data Structures MCQ 2 5
Multiple Choice Data Structures MCQ 3 5

General Programming

Subdomain Challenge Points Solution
Basic Programming Solve Me First 1
Basic Programming Staircase 10
Basic Programming Plus Minus 10
Basic Programming Diagonal Difference 10
Basic Programming A Very Big Sum 10
Basic Programming Simple Array Sum 10
Basic Programming Compare the Triplets 10
Basic Programming Divisible Sum Pairs 10
Basic Programming Kangaroo 10
Basic Programming Drawing Book 10
Basic Programming Birthday Cake Candles 10
Basic Programming Bon Appetit 10
Basic Programming Sock Merchant 10
Basic Programming Apple and Orange 10
Basic Programming Between Two Sets 10
Basic Programming Mini-max Sum 10
Basic Programming Grading Students 10
Basic Programming Breaking the Records 10
Basic Programming Migratory Birds 10
Basic Programming Birthday Chocolate 10
Basic Programming Time Conversion 15
Basic Programming Library Fine 15
Basic Programming Save the Prisoner! 15
Basic Programming Jumping on the Clouds - Revisited 15
Basic Programming Counting Valleys 15
Basic Programming Viral Advertising 15
Basic Programming Beautiful Days at the Movies 15
Basic Programming Electronics Shop 15
Basic Programming Cats and a Mouse 15
Basic Programming The Hurdle Race 15
Basic Programming Utopian Tree 20
Basic Programming Circular Array Rotation 20
Basic Programming Sherlock and Squares 20
Basic Programming Angry Professor 20
Basic Programming Extra Long Factorials 20
Basic Programming Minimum Distances 20
Basic Programming Beautiful Triplets 20
Basic Programming Jumping on the Clouds 20
Basic Programming Equalize the Array 20
Basic Programming Designer PDF Viewer 20
Basic Programming Repeated String 20
Basic Programming Append and Delete 20
Basic Programming Picking Numbers 20
Basic Programming Climbing the Leaderboard 20
Basic Programming Sequence Equation 20
Basic Programming Find Digits 25
Basic Programming Cut the sticks 25
Basic Programming Taum and B'day 25
Basic Programming Flatland Space Stations 25
Basic Programming Fair Rations 25
Basic Programming Manasa and Stones 30
Object-Oriented Programming Class vs. Instance 30
Object-Oriented Programming Inheritance 30
Object-Oriented Programming Abstract Classes 30
RegEx HackerRank in a String! 20

Implementation

Subdomain Challenge Difficulty Solution
Brute Force Pangrams 20
Brute Force Strings: Making Anagrams 25
Brute Force Making Anagrams 30
Brute Force Modified Kaprekar Numbers 30

Java

Subdomain Challenge Points Solution
Introduction Welcome to Java! 3
Introduction Java Stdin and Stdout I 5
Introduction Java If-Else 10
Introduction Java Stdin and Stdout II 10
Introduction Java Output Formatting 10
Introduction Java Loops I 10
Introduction Java Loops II 10
Introduction Java Datatypes 10
Introduction Java End-of-file 10
Introduction Java Static Initializer Block 10
Introduction Java Int to String 10
Introduction Java Date and Time 15
Introduction Java Currency Formatter 15
Strings Java Strings Introduction 5
Strings Java Substring 5
Strings Java String Compare 10
Strings Java String Reverse 10
Strings Java Anagrams 10
Strings Java String Tokens 15
Strings Pattern Syntax Checker 20
Strings Java Regex 25
Strings Java Regex 2 - Duplicate Words 25
Strings Java Regex 3 - Username Checker 20
Strings Tag Content Extractor 20
BigNumber Java BigInteger 10
BigNumber Java BigDecimal 20
BigNumber Java Primality Test 20
Data Structures Java 1D Array 5
Data Structures Java 2D Array 10
Data Structures Java Subarray 10
Data Structures Java Arraylist 10
Data Structures Java 1D Array (Part 2) 25
Data Structures Java List 15
Data Structures Java Map 10
Data Structures Java Stack 20
Data Structures Java Hashset 10
Data Structures Java Generics 15
Data Structures Java Comparator 10
Data Structures Java Sort 10
Data Structures Java Dequeue 20
Data Structures Java BitSet 20
Data Structures Java Priority Queue 20
Object Oriented Programming Java Inheritance I 5
Object Oriented Programming Java Inheritance II 10
Object Oriented Programming Java Abstract Class 10
Object Oriented Programming Java Interface 10
Object Oriented Programming Java Method Overriding 10
Object Oriented Programming Java Method Overriding 2 (Super Keyword) 10
Object Oriented Programming Java Instanceof keyword 10
Object Oriented Programming Java Iterator 15
Object Oriented Programming Calculating Volume 20
Exception Handling Java Exception Handling (Try-catch) 10
Exception Handling Java Exception Handling 15
Advanced Java Varargs - Simple Addition 15
Advanced Java Reflection - Attributes 15
Advanced Can You Access 15
Advanced Prime Checker 25
Advanced Java Factory Pattern 15
Advanced Java Singleton Pattern 15
Advanced Java Visitor Pattern 40
Advanced Java Annotations 25
Advanced Covariant Return Types 20
Advanced Java Lambda Expressions 30
Advanced Java MD5 30
Advanced Java SHA-256 30

SQL

Subdomain Challenge Points Solution
Basic Select Revising the Select Query I 10
Basic Select Revising the Select Query II 10
Basic Select Select All 10
Basic Select Select By ID 10
Basic Select Japanese Cities' Attributes 10
Basic Select Japanese Cities' Names 10
Basic Select Weather Observation Station 1 15
Basic Select Weather Observation Station 3 10
Basic Select Weather Observation Station 4 10
Basic Select Weather Observation Station 5 30
Basic Select Weather Observation Station 6 10
Basic Select Weather Observation Station 7 10
Basic Select Weather Observation Station 8 15
Basic Select Weather Observation Station 9 10
Basic Select Weather Observation Station 10 10
Basic Select Weather Observation Station 11 15
Basic Select Weather Observation Station 12 15
Basic Select Higher Than 75 Marks 15
Basic Select Employee Names 10
Basic Select Employee Salaries 10
Basic Join Asian Population 10
Basic Join African Cities 10
Basic Join Average Population of Each Continent 10
Basic Join The Report 20
Aggregation Revising Aggregations - The Count Function 10
Aggregation Revising Aggregations - The Sum Function 10
Aggregation Revising Aggregations - Averages 10
Aggregation Average Population 10
Aggregation Japan Population 10
Aggregation Population Density Difference 10
Aggregation The Blunder 15
Aggregation Top Earners 20
Aggregation Weather Observation Station 2 15
Aggregation Weather Observation Station 13 10
Aggregation Weather Observation Station 14 10
Aggregation Weather Observation Station 15 15
Aggregation Weather Observation Station 16 10
Aggregation Weather Observation Station 17 15
Aggregation Weather Observation Station 18 25
Aggregation Weather Observation Station 19 30

Inspired from: https://github.com/rshaghoulian/HackerRank_solutions