Skip to content
the poor coder

Home / Topics / #algorithms

#Algorithms

191 posts · page 10 of 10
2020

Hackerrank - Kangaroo Solution

You are choreographing a circus show with various animals. For one act, you are given two kangaroos on a number line ready to jump in the positive direction (i.e, toward positive infinity). The first kangaroo starts at…

2020

Hackerrank - Apple and Orange Solution

Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of…

2020

Hackerrank - Time Conversion Solution

Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a…

2020

Hackerrank - Mini-Max Sum Solution

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two…

2020

Hackerrank - Staircase Solution

Consider a staircase of size : Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase…

2020

Hackerrank - Plus Minus Solution

Given an array of integers, calculate the fractions of its elements that are positive, negative, and are zeros. Print the decimal value of each fraction on a new line. Note: This challenge introduces precision problems…

2020

Hackerrank - A Very Big Sum Solution

Calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large. Function Description Complete the aVeryBigSum function in the editor below. It must return the sum…

2020

Hackerrank - Simple Array Sum Solution

Given an array of integers, find the sum of its elements. For example, if the array ar = [1,2,3], 1+2+3 =6 , so return 6. Function Description Complete the simpleArraySum function in the editor below. It must return the…

ESC