Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2020

Hackerrank - The Hurdle Race Solution

Dan is playing a video game in which his character competes in a hurdle race. Hurdles are of varying heights, and Dan has a maximum height he can jump. There is a magic potion he can take that will increase his maximum…

2020

Hackerrank - Counting Valleys Solution

Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly steps. For every step he took, he noted if it was an uphill, , or a…

2020

Hackerrank - XOR Strings Solution

In this challenge, the task is to debug the existing code to successfully execute all provided test files. Given two strings consisting of digits 0 and 1 only, find the XOR of the two strings. To know more about XOR…

2020

Hackerrank - Smart Number Solution

In this challenge, the task is to debug the existing code to successfully execute all provided test files. A number is called a smart number if it has an odd number of factors. Given some numbers, find whether they are…

2020

Hackerrank - Priyanka and Toys Solution

Priyanka works for an international toy company that ships by container. Her task is to the determine the lowest cost way to combine her orders for shipping. She has a list of item weights. The shipping company has a…

2020

Hackerrank - Find the Median Solution

The median of a list of numbers is essentially it's middle element after sorting. The same number of elements occur after it as before. Given a list of numbers with an odd number of elements, can you find the median?…

2020

Hackerrank - Missing Numbers Solution

Numeros the Artist had two lists that were permutations of one another. He was very proud. Unfortunately, while transporting them from one exhibition to another, some numbers were lost out of the first list. Can you…

2020

Hackerrank - Ice Cream Parlor Solution

Sunny and Johnny like to pool their money and go to the ice cream parlor. Johnny never buys the same flavor that Sunny does. The only other rule they have is that they spend all of their money. Given a list of prices…

2020

Hackerrank - Sherlock and Array Solution

Watson gives Sherlock an array of integers. His challenge is to find an element of the array such that the sum of all elements to the left is equal to the sum of all elements to the right. For instance, given the array…

2020

Hackerrank - Caesar Cipher Solution

Julius Caesar protected his confidential information by encrypting it using a cipher. Caesar's cipher shifts each letter by a number of letters. If the shift takes you past the end of the alphabet, just rotate back to…

2020

Hackerrank - Strong Password Solution

Louise joined a social networking site to stay in touch with her friends. The signup page required her to input a name and a password. However, the password must be strong. The website considers a password to be strong…

2020

Hackerrank - Closest Numbers Solution

Sorting is useful as the first step in many different tasks. The most common task is to make finding things easier, but there are other uses as well. In this case, it will make it easier to determine which pair or pairs…

2020

Hackerrank - Happy Ladybugs Solution

Happy Ladybugs is a board game having the following properties: The board is represented by a string, , of length . The character of the string, , denotes the cell of the board. If is an underscore (i.e., _), it means…

2020

Hackerrank - Strange Counter Solution

Bob has a strange counter. At the first second, it displays the number . Each second, the number displayed by the counter decrements by until it reaches . The counter counts down in cycles. In next second, the timer…

ESC