Skip to content

juletx/HackerRank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HackerRank Challenge Solutions

01. Tutorials

01. 30 Days of Code

Number Challenge Solution Difficulty Score
01 Day 0: Hello, World. java Easy 30
02 Day 1: Data Types java Easy 30
03 Day 2: Operators java Easy 30
04 Day 3: Intro to Conditional Statements java Easy 30
05 Day 4: Class vs. Instance java Easy 30
06 Day 5: Loops java Easy 30
07 Day 6: Let's Review java Easy 30
08 Day 7: Arrays java Easy 30
09 Day 8: Dictionaries and Maps java Easy 30
10 Day 9: Recursion 3 java Easy 30
11 Day 10: Binary Numbers java Easy 30
12 Day 11: 2D Arrays java Easy 30
13 Day 12: Inheritance java Easy 30
14 Day 13: Abstract Classes java Easy 30
15 Day 14: Scope java Easy 30
16 Day 15: Linked List java Easy 30
17 Day 16: Exceptions - String to Integer java Easy 30
18 Day 17: More Exceptions java Easy 30
19 Day 18: Queues and Stacks java Easy 30
20 Day 19: Interfaces java Easy 30
21 Day 20: Sorting java Easy 30
22 Day 21: Generics java Easy 30
23 Day 22: Binary Search Trees java Easy 30
24 Day 23: BST Level-Order Traversal java Easy 30
25 Day 24: More Linked Lists java Easy 30
26 Day 25: Running Time and Complexity java Medium 30
27 Day 26: Nested Logic java Easy 30
28 Day 27: Testing java Easy 30
29 Day 28: RegEx, Patterns, and Intro to Databases java Medium 30
30 Day 29: Bitwise AND java Medium 30

02. 10 Days of Statistics

Number Challenge Solution Difficulty Score
01 Day 0: Mean, Median, and Mode py Easy 30
02 Day 0: Weighted Mean py Easy 30
03 Day 1: Quartiles py Easy 30
04 Day 1: Interquartile Range py Easy 30
05 Day 1: Standard Deviation py Easy 30
06 Day 2: Basic Probability py Easy 10
07 Day 2: More Dice py Easy 10
08 Day 2: Compound Event Probability py Easy 10
09 Day 3: Conditional Probability py Easy 10
10 Day 3: Cards of the Same Suit py Easy 10
11 Day 3: Drawing Marbles py Easy 10
12 Day 4: Binomial Distribution I py Easy 30
13 Day 4: Binomial Distribution II py Easy 30
14 Day 4: Geometric Distribution I py Easy 30
15 Day 4: Geometric Distribution II py Easy 30
16 Day 5: Poisson Distribution I py Easy 30
17 Day 5: Poisson Distribution II py Easy 30
18 Day 5: Normal Distribution I py Easy 30
19 Day 5: Normal Distribution II py Easy 30
20 Day 6: The Central Limit Theorem I py Easy 30
21 Day 6: The Central Limit Theorem II py Easy 30
22 Day 6: The Central Limit Theorem III py Easy 30
23 Day 7: Pearson Correlation Coefficient I py Easy 30
24 Day 7: Spearman's Rank Correlation Coefficient py Easy 30
25 Day 8: Least Square Regression Line py Easy 30
26 Day 8: Pearson Correlation Coefficient II py Easy 10
27 Day 9: Multiple Linear Regression py Medium 30.00

03. 10 Days of Javascript

Number Challenge Solution Difficulty Score
01 Day 0: Hello, World! js Easy 10
02 Day 0: Data Types js Easy 10
03 Day 1: Arithmetic Operators js Easy 10
04 Day 1: Functions js Easy 10
05 Day 1: Let and Const js Easy 10
06 Day 2: Conditional Statements: If-Else js Easy 10
07 Day 2: Conditional Statements: Switch js Easy 10
08 Day 2: Loops js Easy 10
09 Day 3: Arrays js Easy 15
10 Day 3: Try, Catch, and Finally js Easy 15
11 Day 3: Throw js Easy 15
12 Day 4: Create a Rectangle Object js Easy 15
13 Day 4: Count Objects js Easy 15
14 Day 4: Classes js Easy 15
15 Day 5: Inheritance js Easy 15
16 Day 5: Template Literals js Easy 15
17 Day 5: Arrow Functions js Easy 15
18 Day 6: Bitwise Operators js Easy 15
19 Day 6: JavaScript Dates js Easy 15
20 Day 7: Regular Expressions I js Easy 15
21 Day 7: Regular Expressions II js Easy 15
22 Day 7: Regular Expressions III js Easy 15
23 Day 8: Create a Button html Easy 20
24 Day 8: Buttons Container html Easy 25
25 Day 9: Binary Calculator html Medium 30

02. Algorithms

01. Warmup

Number Challenge Solution Difficulty Score
01 Solve Me First java Easy 1
02 Simple Array Sum java Easy 10
03 Compare the Triplets java Easy 10
04 A Very Big Sum java Easy 10
05 Diagonal Difference java Easy 10
06 Plus Minus java Easy 10
07 Staircase java Easy 10
08 Mini-Max Sum java Easy 10
09 Birthday Cake Candles java Easy 10
10 Time Conversion java Easy 15

02. Implementation

Number Challenge Solution Difficulty Score
01 Grading Students java Easy 10
02 Apple and Orange java Easy 10
03 Number Line Jumps java Easy 10
04 Between Two Sets java Easy 10
05 Breaking the Records java Easy 10
06 Subarray Division java Easy 10
07 Divisible Sum Pairs java Easy 10
08 Migratory Birds java Easy 10
10 Sales by Match py Easy 10
12 Counting Valleys py Easy 15
35 Jumping on the Clouds py Easy 20
36 Repeated String py Easy 20

04. Sorting

Number Challenge Solution Difficulty Score
03 Insertion Sort - Part 1 java Easy 30
04 Insertion Sort - Part 2 java Easy 30

06. Graph Theory

Number Challenge Solution Difficulty Score
01 Roads and Libraries java Medium 30
05 Breadth First Search: Shortest Reach java Medium 55

09. Constructive Algorithms

Number Challenge Solution Difficulty Score
03 New Year Chaos py Medium 40

03. Data Structures

01. Arrays

Number Challenge Solution Difficulty Score
01 Arrays - DS java Easy 10
02 2D Array - DS java Easy 15
03 Dynamic Array java Easy 15
04 Left Rotation java Easy 20
05 Sparse Arrays java Medium 25
06 Array Manipulation java Hard 60

02. Linked Lists

Number Challenge Solution Difficulty Score
01 Print the Elements of a Linked List java Easy 5
02 Insert a Node at the Tail of a Linked List java Easy 5
03 Insert a node at the head of a linked list java Easy 5
04 Insert a node at a specific position in a linked list java Easy 5
05 Delete a Node java Easy 5
06 Print in Reverse java Easy 5
07 Reverse a linked list java Easy 5
08 Compare two linked lists java Easy 5
09 Merge two sorted linked lists java Easy 5
10 Get Node Value java Easy 5
11 Delete duplicate-value nodes from a sorted linked list java Easy 5
12 Cycle Detection java Medium 5
13 Find Merge Point of Two Lists java Easy 5
14 Inserting a Node Into a Sorted Doubly Linked List java Easy 5
15 Reverse a doubly linked list java Easy 5

03. Trees

Number Challenge Solution Difficulty Score
01 Tree: Preorder Traversal java Easy 10
02 Tree: Postorder Traversal java Easy 10
03 Tree: Inorder Traversal java Easy 10
04 Tree: Height of a Binary Tree java Easy 10
05 Tree: Level Order Traversal java Easy 20
06 Binary Search Tree : Insertion java Easy 20
08 Binary Search Tree : Lowest Common Ancestor java Easy 30

05. Stacks

Number Challenge Solution Difficulty Score
01 Balanced Brackets java Medium 25
02 Equal Stacks java Easy 25
06 Simple Text Editor java Medium 65

06. Queues

Number Challenge Solution Difficulty Score
01 Queue using Two Stacks java Medium 30

04. Mathemathics

01. Fundamentals

Number Challenge Solution Difficulty Score
01 Find the Point py Easy 5

05. Artificial Intelligence

01. Bot Building

Number Challenge Solution Difficulty Score
01 Bot saves princess py Easy 13
02 Bot saves princess - 2 py Easy 17

06. C

01. Introduction

Number Challenge Solution Difficulty Score
01 "Hello World!" in C c Easy 5
02 Playing With Characters c Easy 5
03 Sum and Difference of Two Numbers c Easy 5
04 Functions in C c Easy 10
05 Pointers in C c Easy 10

02. Conditionals and Loops

Number Challenge Solution Difficulty Score
01 Conditional Statements in C c Easy 10
02 For Loop in C c Easy 10
03 Sum of Digits of a Five Digit Number c Easy 15
04 Bitwise Operators c Easy 15
05 Printing Pattern Using Loops c Medium 30

03. Arrays and Strings

Number Challenge Solution Difficulty Score
01 1D Arrays in C c Medium 10
02 Array Reversal c Medium 20
03 Printing Tokens c Medium 20
04 Digit Frequency c Medium 25
05 Dynamic Array in C c Medium 40

04. Functions

Number Challenge Solution Difficulty Score
01 Calculate the Nth term c Easy 15
02 Students Marks Sum c Easy 20
03 Sorting Array of Strings c Hard 40
04 Permutations of Strings c Medium 40
05 Variadic functions in C c Medium 50
06 Querying the Document c Hard 60

05. Structs and Enums

Number Challenge Solution Difficulty Score
01 Boxes through a Tunnel c Easy 25
02 Small Triangles, Large Triangles c Medium 30

07. C++

01. Introduction

Number Challenge Solution Difficulty Score
01 Say "Hello, World!" With C++ cpp Easy 5
02 Input and Output cpp Easy 5
03 Basic Data Types cpp Easy 10
04 Conditional Statements cpp Easy 10
05 For Loop cpp Easy 10
06 Pointer cpp Easy 10
07 Arrays Introduction cpp Easy 10
08 Variable Sized Arrays cpp Easy 30

02. Strings

Number Challenge Solution Difficulty Score
01 Attribute Parser cpp Medium 35
02 StringStream cpp Easy 10
03 Strings cpp Easy 10

03. Classes

Number Challenge Solution Difficulty Score
01 Structs cpp Easy 10
02 Class cpp Easy 10
03 Classes and Objects cpp Easy 20
04 Box It! cpp Easy 30
05 Inherited Code cpp Medium 30

08. Java

01. Introduction

Number Challenge Solution Difficulty Score
01 Welcome to Java! java Easy 3
02 Java Stdin and Stdout I java Easy 5
03 Java If-Else java Easy 10
04 Java Stdin and Stdout II java Easy 10
05 Java Output Formatting java Easy 10
06 Java Loops I java Easy 10
08 Java Loops II java Easy 10
09 Java Datatypes java Easy 10
10 Java End-of-file java Easy 10
11 Java Static Initializer Block java Easy 10
12 Java Int to String java Easy 10
13 Java Date and Time java Easy 15
14 Java Currency Formatter java Easy 15

02. Strings

Number Challenge Solution Difficulty Score
01 Java Strings Introduction java Easy 5
02 Java Substring java Easy 5
03 Java Substring Comparisons java Easy 10
04 Java String Reverse java Easy 10
05 Java Anagrams java Easy 10
06 Java String Tokens java Easy 15
07 Pattern Syntax Checker java Easy 20
08 Java Regex java Medium 25
09 Java Regex 2 - Duplicate Words java Medium 12.50

09. Python

01. Introduction

Number Challenge Solution Difficulty Score
01 Say "Hello, World!" With Python py Easy 5
02 Python If-Else py Easy 10
03 Arithmetic Operators py Easy 10
04 Python: Division py Easy 10
05 Loops py Easy 10
06 Write a function py Medium 10
07 Print Function py Easy 20

02. Basic Data Types

Number Challenge Solution Difficulty Score
01 List Comprehensions py Easy 10
02 Find the Runner-Up Score! py Easy 10
03 Nested Lists py Easy 10
04 Finding the percentage py Easy 10
05 Lists py Easy 10
06 Tuples py Easy 10

03. Strings

Number Challenge Solution Difficulty Score
01 sWAP cASE py Easy 10
02 String Split and Join py Easy 10
03 What's Your Name? py Easy 10
04 Mutations py Easy 10
05 Find a string py Easy 10
06 String Validators py Easy 10
07 Text Alignment py Easy 10
08 Text Wrap py Easy 10
09 Designer Door Mat py Easy 10
10 String Formatting py Easy 10
11 Alphabet Rangoli py Easy 20
12 Capitalize! py Easy 20

04. Sets

Number Challenge Solution Difficulty Score
01 Introduction to Sets py Easy 10
02 No Idea! py Medium 50
03 Symmetric Difference py Easy 10
04 Set .add() py Easy 10
05 Set .discard(), .remove() & .pop() py Easy 10
06 Set .union() Operation py Easy 10
07 Set .intersection() Operation py Easy 10
08 Set .difference() Operation py Easy 10
09 Set .symmetric_difference() Operation py Easy 10
10 Set Mutations py Easy 10
11 The Captain's Room py Easy 10
12 Check Subset py Easy 10
13 Check Strict Superset py Easy 10

05. Math

Number Challenge Solution Difficulty Score
01 Polar Coordinates py Easy 10

10. Ruby

01. Introduction

Number Challenge Solution Difficulty Score
01 Ruby Tutorial - Hello HackerRank! rb Easy 5
02 Ruby Tutorial - Everything is an Object rb Easy 10
03 Ruby Tutorial - Object Methods rb Easy 10
04 Ruby Tutorial - Object Method Parameters rb Easy 10

02. Control Structures

Number Challenge Solution Difficulty Score
01 Ruby Control Structures - Each rb Easy 10
02 Ruby Control Structures - Unless rb Easy 10
03 Ruby Control Structures - Infinite Loop rb Easy 10
04 Ruby Control Structures - Until rb Easy 10
05 Ruby Control Structures - Case (Bonus Question) rb Medium 20

03. Arrays & Hashes

Number Challenge Solution Difficulty Score
01 Ruby Array - Initialization rb Easy 10
02 Ruby Array - Index, Part 1 rb Easy 10
03 Ruby Array - Index, Part 2 rb Easy 10
04 Ruby Array - Addition rb Easy 10
05 Ruby Array - Deletion rb Easy 10
06 Ruby Array - Selection rb Easy 10
07 Ruby Hash - Initialization rb Easy 10
08 Ruby Hash - Each rb Easy 10
09 Ruby Hash - Addition, Deletion, Selection rb Easy 10

04. Enumerables

Number Challenge Solution Difficulty Score
01 Ruby - Enumerable - Introduction rb Medium 10
02 Ruby - Enumerable - each_with_index rb Medium 10
03 Ruby - Enumerable - collect rb Medium 10
04 Ruby - Enumerable - reduce rb Medium 10
05 Ruby Enumerables: 'any', 'all', 'none', and 'find' rb Medium 15
06 Ruby - Enumerable - group_by rb Medium 15

05. Methods

Number Challenge Solution Difficulty Score
01 Ruby - Methods - Introduction rb Easy 10
02 Ruby - Methods - Arguments rb Medium 15
03 Ruby - Methods - Variable Arguments rb Easy 15
04 Ruby - Methods - Keyword Arguments rb Medium 20
05 Blocks rb Easy 30
06 Procs rb Easy 30
07 Lambdas rb Easy 30
08 Closures rb Easy 30
09 Partial Applications rb Easy 30
10 Currying rb Easy 30
11 Lazy Evaluation rb Medium 30

06. Strings

Number Challenge Solution Difficulty Score
01 Ruby - Strings - Introduction rb Easy 10
02 Ruby - Strings - Encoding rb Easy 15
03 Ruby - Strings - Indexing rb Easy 15
04 Ruby - Strings - Iteration rb Easy 15
05 Ruby - Strings - Methods I rb Easy 15
06 Ruby - Strings - Methods II rb Easy 15

11. SQL

01. Basic Select

Number Challenge Solution Difficulty Score
01 Revising the Select Query I sql Easy 10
02 Revising the Select Query II sql Easy 10
03 Select All sql Easy 10
04 Select By ID sql Easy 10
05 Japanese Cities' Attributes sql Easy 10
06 Japanese Cities' Names sql Easy 10
07 Weather Observation Station 1 sql Easy 15
08 Weather Observation Station 3 sql Easy 10
09 Weather Observation Station 4 sql Easy 10
10 Weather Observation Station 5 sql Easy 30
11 Weather Observation Station 6 sql Easy 10
12 Weather Observation Station 7 sql Easy 10
13 Weather Observation Station 8 sql Easy 15
14 Weather Observation Station 9 sql Easy 10
15 Weather Observation Station 10 sql Easy 10
16 Weather Observation Station 11 sql Easy 15
17 Weather Observation Station 12 sql Easy 15
18 Higher Than 75 Marks sql Easy 15
19 Employee Names sql Easy 10
20 Employee Salaries sql Easy 10

02. Advanced Select

Number Challenge Solution Difficulty Score
01 Type of Triangle sql Easy 20
02 The PADS sql Medium 30
03 Occupations sql Medium 30
04 Binary Tree Nodes sql Medium 30
05 New Companies sql Medium 30

03. Aggregation

Number Challenge Solution Difficulty Score
01 Revising Aggregations - The Count Function sql Easy 10
02 Revising Aggregations - The Sum Function sql Easy 10
03 Revising Aggregations - Averages sql Easy 10
04 Average Population sql Easy 10
05 Japan Population sql Easy 10
06 Population Density Difference sql Easy 10
07 The Blunder sql Easy 15
08 Top Earners sql Easy 20
09 Weather Observation Station 2 sql Easy 15
10 Weather Observation Station 13 sql Easy 10
11 Weather Observation Station 14 sql Easy 10
12 Weather Observation Station 15 sql Easy 15
13 Weather Observation Station 16 sql Easy 10
14 Weather Observation Station 17 sql Easy 15
15 Weather Observation Station 18 sql Medium 25
16 Weather Observation Station 19 sql Medium 30
17 Weather Observation Station 20 sql Medium 40

12. Databases

01. Relational Algebra

Number Challenge Solution Difficulty Score
01 Basics of Sets and Relations #1 txt Easy 5
02 Basics of Sets and Relations #2 txt Easy 5
03 Basics of Sets and Relations #3 txt Easy 5
04 Basics of Sets and Relations #4 txt Easy 5
05 Basics of Sets and Relations #5 txt Easy 5
06 Basics of Sets and Relations #6 txt Easy 5
07 Basics of Sets and Relations #7 txt Easy 5
08 Relational Algebra - 3 txt Easy 10
09 Relational Algebra - 4 txt Easy 10
10 Database Query Languages txt Easy 10
11 Procedural Language txt Easy 10
12 Relations - 1 txt Easy 10
13 Relations - 2 txt Easy 10

13. Distributed Systems

01. Multiple Choice

Number Challenge Solution Difficulty Score
01 RPC - 1 txt Easy 10
02 RPC - 2 txt Easy 10

14. Linux Shell

01. Bash

Number Challenge Solution Difficulty Score
01 Let's Echo sh Easy 1

15. Functional Programming

01. Introduction

Number Challenge Solution Difficulty Score
01 Solve Me First FP hs Easy 3
02 Hello World hs Easy 5
03 Hello World N Times hs Easy 5

16. Regex

01. Introduction

Number Challenge Solution Difficulty Score
01 Matching Specific String py Easy 5
02 Matching Anything But a Newline py Easy 5
03 Matching Digits & Non-Digit Characters py Easy 5
04 Matching Whitespace & Non-Whitespace Character py Easy 5
05 Matching Word & Non-Word Character py Easy 5
06 Matching Start & End py Easy 5

17. Security

01. Functions

Number Challenge Solution Difficulty Score
01 Security Functions py Easy 5

18. Interview Preparation Kit

01. Warm-up Challenges

Number Challenge Solution Difficulty Score
01 Sales by Match py Easy 10
02 Counting Valleys py Easy 15
03 Jumping on the Clouds py Easy 20
04 Repeated String py Easy 20

02. Arrays

Number Challenge Solution Difficulty Score
01 2D Array - DS java Easy 15
02 Arrays: Left Rotation java Easy 20
03 New Year Chaos py Medium 40
04 Minimum Swaps 2 py Medium 40
05 Array Manipulation java Hard 60

09. Stacks and Queues

Number Challenge Solution Difficulty Score
01 Balanced Brackets java Medium 25

10. Graphs

Number Challenge Solution Difficulty Score
01 Roads and Libraries java Medium 30

11. Trees

Number Challenge Solution Difficulty Score
01 Tree: Height of a Binary Tree java Easy 10
02 Binary Search Tree : Lowest Common Ancestor java Easy 30

12. Linked Lists

Number Challenge Solution Difficulty Score
01 Insert a node at a specific position in a linked list java Easy 5
02 Inserting a Node Into a Sorted Doubly Linked List java Easy 5
03 Reverse a doubly linked list java Easy 5
04 Find Merge Point of Two Lists java Easy 5
05 Linked Lists: Detect a Cycle java Easy 25

19. Contests

01. ProjectEuler+

Number Challenge Solution Difficulty Score
001 Project Euler #1: Multiples of 3 and 5 py Easy 100