Skip to content
the poor coder

Home / Topics / #algorithms

#Algorithms

191 posts · page 7 of 10
2020

Hackerrank - Taum and B'day Solution

Taum is planning to celebrate the birthday of his friend, Diksha. There are two types of gifts that Diksha wants from Taum: one is black and the other is white. To make her happy, Taum has to buy black gifts and white…

2020

Hackerrank - Equalize the Array Solution

Karl has an array of integers. He wants to reduce the array until all remaining elements are equal. Determine the minimum number of elements to delete to reach his goal. For example, if his array is , we see that he can…

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…

ESC