Hackerrank – Week of Code 22

I participated in an another programming contest organized by Hackerrank. It was Week of Code 22 from 8.8.2016, 09:00 AM CEST to 15.8.2016 AM CEST It was my 14th contest at Hackerrank and I think I was quite successfull because I earned my second bronze medal. I was able to solve 3 challenges: Cookie Party […]

Hackerrank – Compare The Triplets

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Read all ratings and compare it according to the defined conditions: If ai > bi, then Alice is awarded 1 point If ai < bi, then Bob is awarded 1 point If ai = bi, then neither person receives a […]

Hackerrank – The Maximum Subarray

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Contiguous sum – using Kadane’s algorithm Non-contiguous sum – filter all positive elements from given array and sum them. If this array is empty. Take the greatest element. I created solution in: Scala Java JavaScript Ruby All solutions are also […]

Hackerrank – Functions Or Not?

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Check if for a given value x is always only one function output value y. See function definition. I created solution in: Scala All solutions are also available on my GitHub. Scala

Hackerrank – String-o-Permute

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution For every input line: divide into character pairs reverse order of characters concat the pairs it into the one string I created solution in: Scala All solutions are also available on my GitHub. Scala

Hackerrank – String Mingling

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Iterate through one of the strings and concatenate each actual character. I created solution in: Scala All solutions are also available on my GitHub. Scala

Hackerrank – Area Under Curves and Volume of Revolving a Curve

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution function f is an applied algebraic expression to x as in problem description function area is area of the cycle ($$\Pi r^2$$) with center 0 and radius value of function(x) function summation is applied once for function f and one […]

Hackerrank – Cut the sticks

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Until the sticks array is empty: print the length of sticks array sort the array get the minimum value as first element of the array cut the array filtering only values greater than minimum I created solution in: Scala Java […]

Hackerrank – Sherlock and Squares

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution We have to prevent timeout, because there is big upper constraint. For a given numbers a and b we can find out all square numbers with formula:     . There is a special case when a and b are […]

Hackerrank – Modified Kaprekar Numbers

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution Iterate from p to q and check if actual number Kaprekar number (the addition of 2 parts of squared number is equal to actual number) I created solution in: Scala Java JavaScript Ruby All solutions are also available on my […]