Skip to content

jaimiles23/HackerRank_Solutions

Repository files navigation

hackerrank logo

HackerRank

HackerRank hosts challenges to learn, practice, and refine your programming skills. This repository contains my solutions to HackerRank challenges.

Please note that this README is dynamically updated. I created scripts in the automation directory to (1) webscrape challenge information, (2) update this README file, and (3) select challenges to complete and push commits to this repository.

Table of Contents

SQL

Contains solutions to sql using MySQL.

NOTE: When using Common Table Expressions (CTE), must use the MS SQL Server Console.

SQL logo


Basic Select

Contains solutions to Basic Select.


Number Challenge Score Difficulty Rate Solution
1 Revising the Select Query I 10 96.02% sql
2 Revising the Select Query II 10 98.82% sql
3 Select All 10 99.69% sql
4 Select By ID 10 99.71% sql
5 Japanese Cities' Attributes 10 99.69% sql
6 Japanese Cities' Names 10 99.72% sql
7 Weather Observation Station 1 15 99.53% sql
8 Weather Observation Station 3 10 97.48% sql
9 Weather Observation Station 4 10 98.55% sql
10 Weather Observation Station 5 30 93.24% sql
11 Weather Observation Station 6 10 98.45% sql
12 Weather Observation Station 7 10 99.10% sql
13 Weather Observation Station 8 15 98.62% sql
14 Weather Observation Station 9 10 99.17% sql
15 Weather Observation Station 10 10 99.47% sql
16 Weather Observation Station 11 15 98.51% sql
17 Weather Observation Station 12 15 98.79% sql
18 Higher Than 75 Marks 15 98.86% sql
19 Employee Names 10 99.74% sql
20 Employee Salaries 10 99.67% sql

⬆️ Table of Contents

Advanced Select

Contains solutions to Advanced Select.


Number Challenge Score Difficulty Rate Solution
1 Type of Triangle 20 95.81% sql
2 The PADS 30 ⭐⭐ 93.19% sql

⬆️ Table of Contents

Aggregation

Contains solutions to Aggregation.


Number Challenge Score Difficulty Rate Solution
1 Revising Aggregations - The Count Function 10 99.50% sql
2 Revising Aggregations - The Sum Function 10 99.64% sql
3 Revising Aggregations - Averages 10 99.80% sql
4 Average Population 10 99.53% sql
5 Japan Population 10 99.86% sql
6 Population Density Difference 10 99.84% sql
7 The Blunder 15 97.83% sql
8 Top Earners 20 97.90% sql
9 Weather Observation Station 2 15 99.37% sql
10 Weather Observation Station 13 10 99.49% sql
11 Weather Observation Station 14 10 99.69% sql
12 Weather Observation Station 15 15 98.99% sql
13 Weather Observation Station 16 10 99.77% sql
14 Weather Observation Station 17 15 99.34% sql
15 Weather Observation Station 18 25 ⭐⭐ 98.52% sql
16 Weather Observation Station 19 30 ⭐⭐ 98.44% sql
17 Weather Observation Station 20 40 ⭐⭐ 96.28% sql

⬆️ Table of Contents

Basic Join

Contains solutions to Basic Join.


Number Challenge Score Difficulty Rate Solution
1 Asian Population 10 98.43% sql
2 African Cities 10 99.37% sql
3 Average Population of Each Continent 10 97.94% sql
4 The Report 20 ⭐⭐ 96.98% sql
5 Top Competitors 30 ⭐⭐ 96.11% sql
6 Ollivander's Inventory 30 ⭐⭐ 94.08% sql
7 Challenges 30 ⭐⭐ 92.02% sql
8 Contest Leaderboard 30 ⭐⭐ 97.44% sql

⬆️ Table of Contents

Statistics

Contains solutions to 10 Days of Statistics.

All solutions (excluding multivariate linear regression) are implemented in Python 3 without using 3rd party statistical libraries. Solutions in .ipynb format include relevant problem notes, formulas, and examples.

NOTE: GitHub does not consistently render .ipynb files. This is a well documented issue. To workaround this issue, access the github url via nbviewer.org in the Solution 2 column.

statistics logo


10_Days

Contains solutions to HackerRank's 10 days of statistics challenge.


Number Challenge Score Difficulty Rate Solution Solution 2
1 Day 0: Mean, Median, and Mode 30 87.31% ipynb nbviewer
2 Day 0: Weighted Mean 30 96.78% ipynb nbviewer
3 Day 1: Quartiles 30 91.92% ipynb nbviewer
4 Day 1: Interquartile Range 30 93.87% ipynb nbviewer
5 Day 1: Standard Deviation 30 98.77% ipynb nbviewer
6 Day 2: Basic Probability 10 MC 69.72% ipynb nbviewer
7 Day 2: More Dice 10 MC 84.17% ipynb nbviewer
8 Day 2: Compound Event Probability 10 MC 78.13% ipynb nbviewer
9 Day 3: Conditional Probability 10 MC 49.26% ipynb nbviewer
10 Day 3: Cards of the Same Suit 10 MC 84.13% ipynb nbviewer
11 Day 3: Drawing Marbles 10 MC 87.66% ipynb nbviewer
12 Day 4: Binomial Distribution I 30 93.65% ipynb nbviewer
13 Day 4: Binomial Distribution II 30 97.65% ipynb nbviewer
14 Day 4: Geometric Distribution I 30 98.76% ipynb nbviewer
15 Day 4: Geometric Distribution II 30 97.54% ipynb nbviewer
16 Day 5: Poisson Distribution I 30 98.77% ipynb nbviewer
17 Day 5: Poisson Distribution II 30 97.66% ipynb nbviewer
18 Day 5: Normal Distribution I 30 95.55% ipynb nbviewer
19 Day 5: Normal Distribution II 30 97.93% ipynb nbviewer
20 Day 6: The Central Limit Theorem I 30 97.12% ipynb nbviewer
21 Day 6: The Central Limit Theorem II 30 98.84% ipynb nbviewer
22 Day 6: The Central Limit Theorem III 30 97.88% ipynb nbviewer
23 Day 7: Pearson Correlation Coefficient I 30 98.61% ipynb nbviewer
24 Day 7: Spearman's Rank Correlation Coefficient 30 98.83% ipynb nbviewer
25 Day 8: Least Square Regression Line 30 96.66% ipynb nbviewer
26 Day 8: Pearson Correlation Coefficient II 30 MC 57.60% ipynb nbviewer
27 Day 9: Multiple Linear Regression 30 ⭐⭐ 95.59% ipynb nbviewer

⬆️ Table of Contents

Databases

Contains solutions to HackerRank's databases challenges.

database logo


Relational Algebra

Contains solutions to HackerRank's databases Relational Algebra challenges.

Relational Algebra

relational algebra is to provide a theoretical foundation for relational databases, particularly query languages for such databases, chief among which is SQL. Relational databases store tabular data represented as relations. Queries over relational databases often likewise return tabular data represented as relations. The main premise of the relational algebra is to define operators that transform one or more input relations to an output relation.


Number Challenge Score Difficulty Rate Solution
1 Basics of Sets and Relations #1 5 90.73% md
2 Basics of Sets and Relations #2 5 97.48% md
3 Basics of Sets and Relations #3 5 97.40% md
4 Basics of Sets and Relations #4 5 96.91% md
5 Basics of Sets and Relations #5 5 97.79% md
6 Basics of Sets and Relations #6 5 97.02% md
7 Basics of Sets and Relations #7 5 98.24% md
8 Relational Algebra - 3 2 MC 67.45% md
9 Relational Algebra - 4 2 MC 62.70% md
10 Database Query Languages 2 MC 84.37% md
11 Procedural Language 2 MC 46.76% md
12 Relations - 1 2 MC 68.18% md
13 Relations - 2 2 MC 74.00% md

⬆️ Table of Contents

Indexes

Contains solutions to Indexes.

Database Index

A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and storage space to maintain the index data structure.


Number Challenge Score Difficulty Rate Solution
1 Index Architecture Types 2 - 61.20% md
2 Indexes - 2 2 MC 51.46% md
3 Indexes - 3 2 MC 50.44% md
4 Indexes - 4 2 MC 69.61% md

⬆️ Table of Contents

OLAP

Contains solutions to HackerRank's OLAP challenges.

OLAP

Online analytical processing is an approach to answer multi-dimensional analytical (MDA) queries swiftly in computing. OLAP is part of the broader category of business intelligence, which also encompasses relational databases, report writing and data mining. OLAP tools enable users to analyze multidimensional data interactively from multiple perspectives


Number Challenge Score Difficulty Rate Solution
1 OLAP Performance 5 - 74.77% md
2 OLAP Operations - 1 5 MC 43.92% md
3 OLAP Operations - 2 5 MC 65.58% md
4 OLAP Cube Metadata 5 MC 63.26% md
5 OLAP Name(s) 5 MC 60.87% md
6 The Total View 5 MC 55.59% md

⬆️ Table of Contents

Set And Algebra

Contains solutions to Set and Algebra.


Number Challenge Score Difficulty Rate Solution
1 Databases - Relational Calculus 5 ⭐⭐ 84.56% md
2 Databases - Keys 5 ⭐⭐ 97.91% md
3 Databases - Natural Joins 5 ⭐⭐ 95.39% md
4 Databases - Differences 5 ⭐⭐ 96.96% md

⬆️ Table of Contents

Python

Contains solutions to HackerRank's python challenges using Python3.

python logo


Introduction

Contains solutions to introduction.


Number Challenge Score Difficulty Rate Solution
1 Say "Hello, World!" With Python 5 97.62% py
2 Python If-Else 10 91.31% py
3 Arithmetic Operators 10 98.44% py
4 Python: Division 10 98.87% py
5 Loops 10 98.48% py
6 Write a function 10 ⭐⭐ 90.61% py
7 Print Function 20 96.50% py

⬆️ Table of Contents

Basic Data Types

Contains solutions to Basic Data Types.


Number Challenge Score Difficulty Rate Solution
1 List Comprehensions 10 98.27% py
2 Find the Runner-Up Score! 10 93.80% py
3 Nested Lists 10 90.65% py
4 Finding the percentage 10 97.34% py
6 Tuples 10 98.40% py

⬆️ Table of Contents

Strings

Contains solutions to Strings.


Number Challenge Score Difficulty Rate Solution
1 sWAP cASE 10 98.63% py
2 String Split and Join 10 98.88% py
3 What's Your Name? 10 97.87% py
4 Mutations 10 98.54% py
5 Find a string 10 93.24% py
6 String Validators 10 93.34% py
7 Text Alignment 10 97.67% py
8 Text Wrap 10 98.74% py
9 Designer Door Mat 10 98.28% py
10 String Formatting 10 90.21% py
11 Alphabet Rangoli 20 96.74% py
12 Capitalize! 20 82.59% py
13 The Minion Game 40 ⭐⭐ 85.06% py
14 Merge the Tools! 40 ⭐⭐ 92.11% py

⬆️ Table of Contents

Sets

Contains solutions to Sets.


Number Challenge Score Difficulty Rate Solution
1 Introduction to Sets 10 98.51% py
2 No Idea! 50 ⭐⭐ 85.81% py
3 Symmetric Difference 10 97.89% py
4 Set .add() 10 99.18% py
5 Set .discard(), .remove() & .pop() 10 96.32% py
6 Set .union() Operation 10 99.19% py
7 Set .intersection() Operation 10 - 99.51% py
8 Set .difference() Operation 10 - 99.41% py
9 Set .symmetric_difference() Operation 10 99.50% py
10 Set Mutations 10 98.24% py
11 The Captain's Room 10 89.99% py
12 Check Subset 10 98.65% py

⬆️ Table of Contents

About

Solutions to programming challenges

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published