Skip to content

πŸ€“ The purpose of this repository is to backup my solutions to the challenges I've solved in HackerRank.

Notifications You must be signed in to change notification settings

iramirezc-learning/my-hacker-rank-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My HackerRank Solutions

The purpose of this repository is to backup my solutions to the challenges I've solved in HackerRank.

Problems

How to use this repo

Clone the repository:

git clone https://github.com/iramirezc-learning/my-hacker-rank-solutions.git

Install the dependencies:

cd my-hacker-rank-solutions
npm install

Run the tests:

npm run test

Create the files for a new challenge

Run the challenge script with the new path for the challenge.

Syntax

./scripts/challenge <new-path>

Example

Note: Change new-challenge with the actual name of the problem.

$ ./scripts/challenge src/problems/new-challenge

# Created 'src/problems/new-challenge'
# Created 'src/problems/new-challenge/README.md'
# Created 'src/problems/new-challenge/new-challenge.js'
# Created 'src/problems/new-challenge/index.js'
# Created 'src/problems/new-challenge/specs'
# Created 'src/problems/new-challenge/specs/new-challenge.spec.js'
# Created 'src/problems/new-challenge/specs/input'
# Created 'src/problems/new-challenge/specs/output'

Finally, add the test cases files to the input and output directories. Note: Make sure to use the same name for each test case:

Example of the file tree created:
.
β”œβ”€ src
β”‚  β”œβ”€ problems
β”‚  β”‚  β”œβ”€ new-challenge
β”‚  β”‚  β”‚  β”œβ”€ specs
β”‚  β”‚  β”‚  β”‚  β”œβ”€ input
β”‚  β”‚  β”‚  β”‚  β”‚  └─ 00.txt # add input test case file
β”‚  β”‚  β”‚  β”‚  β”œβ”€ output
β”‚  β”‚  β”‚  β”‚  β”‚  └─ 00.txt # add output test case file matching input file name
β”‚  β”‚  β”‚  β”‚  β”œβ”€ new-challenge.spec.js
β”‚  β”‚  β”‚  β”œβ”€ index.js
β”‚  β”‚  β”‚  β”œβ”€ new-challenge.js
β”‚  β”‚  β”‚  └─ README.md

About

πŸ€“ The purpose of this repository is to backup my solutions to the challenges I've solved in HackerRank.

Topics

Resources

Stars

Watchers

Forks