We're going to be doing a HackerRank challenge every day!
I'll post the challenge we'll be doing every day. Commit your solution file into the appropriate folder with your name as the file name. For example, a submission could be Aravind.java or Naren.py. If you have any questions on the daily challenge, feel free to reach out to anyone else working on it.
go to your command line, and navigate into the folder you want it.
run this:
git clone https://github.com/Perilynn/HackerRank-Coding-Challenges.git
When you want to submit your code, drop the file into the corresponding sub-folder (e.x. Combinatorics, Sorting, etc.), and run the following:
git add YourName.filetype //e.x. Aravind.java
git commit -m "submission"
git pull // to prevent conflicts, always pull first
git push origin master
- Closest Number - May 18
- Category: Sorting
- https://hackerrank.com/challenges/closest-number
- Median Updates - May 19
- Category: Data Structures
- https://hackerrank.com/challenges/median-updates
- Diwali Lights - May 20
- Category: Combinatorics
- https://hackerrank.com/challenges/diwali-lights
- Coin Challenge - May 21
- Category: Dynamic Programming
- https://hackerrank.com/challenges/coin-challenge
- The Trigonometric Ratios (Code Golf) - May 23
- https://www.hackerrank.com/challenges/trignometric-ratios
- Code Golf is a special kind of problem. Your score on the challenge is based on the number of lines it takes to solve the problem. The less lines, the higher the score (just like golf!). Of course, your code also has to solve the challenge correctly. You have until Sunday night for this challenge, so have at it!
- PUT YOUR SCORE IN YOUR FILE AS WELL!!!!!
- Fraud Detection - May 27
- Category: Strings
- https://www.hackerrank.com/challenges/fraud-prevention
- Connected Cell in a Grid - June 1
- Category: Search
- https://www.hackerrank.com/challenges/connected-cell-in-a-grid
- Grid Challenge - June 4
- Category: Greedy
- https://www.hackerrank.com/challenges/grid-challenge
- Maximize Sum - June 5
- Category: Search
- https://www.hackerrank.com/challenges/maximise-sum
- Snakes and Ladders: The Quickest Way Up - June 8
- Category: Graph Theory
- https://www.hackerrank.com/challenges/the-quickest-way-up
#Fun Problems:
- Create an exponent function
exp(x,y)
that does x^y in O(log n) time - Given a char array with padded memory and a zero byte, replace all '.' with ';;'
- E.g input might be:
- |Index| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
- |Value| \0 | - | r | - | 5 | - | . | - | 4 |
- Outputs: [\0,r,5,;,;,4]
- Given a class
Interval
which has a start and end point as int and a list of suchInterval
s, write a method to insert anotherInterval
into the list
- E.g <4,7><10,15><20,21>
- insert <5,8> gets <4,8><10,15><20,21>
- insert <16,17> gets <4,8><10,15><16,17><20,21>
- insert <1,30> gets <1,30>
- In a tree of nodes, where each node is defined as
class node
{
public:
int value;
vector <node*> children
vector <node*> siblings
};
assume given a tree, all nodes have their children vectors filled. fill their siblings vector
Convert string to int manually, and convert an int to a string manually
E.x. "123" (type string) to 123 (type int)
and 123 (type int) to "123" (type string) (boilerplate c++ example)
int toInt(string x) {
//your code here
}
string toString(int x) {
//your code here
}
Boolean function isNumber. given a string, return true if it is a valid number, return false if not. dont forget to account negatives and decimals