Category: Hackerrank

10
Feb
2020

Hackerrank Minimum Distances (C++)

C++ : Explanation: First, assign a large number to maxInt and assign it to minDist. In this case, we use the largest possible int, 2,147,483,647. Using a double nested for loop, loop through...

29
Jan
2020

Hackerrank Cut the sticks (Java)

Java : Explanation: Warning: Lots of converting from ArrayLists to Arrays and vice versa ahead! First, convert the ArrayList sticks to store the number of sticks left after each cut-and-throw round. Add the...

20
Jan
2020

Hackerrank Find Digits (C++)

C++ : Explanation: This question basically deals with getting individual digits from a number with mod (%) and integer division. In the while loop, we will loop till nHolder (temporary holder for n)...

19
Jan
2020

Hackerrank Sequence Equation (C++)

C++ : Explanation: Note: This is a terrible, terrible solution. Look at the number of nested loops! Yes, it works, but loopsss! The question was not easy to understand, so the breakdown is...