Hackerrank – Plus Minus

Problem Statement A description of the problem can be found on Hackerrank. Solution After reading all numbers in array, you have to filter this array according to three conditions – number greater than zero, lower then zero and equals to zero. Count the subarrays and divide by array length. I created solution in 4 languages: […]

Hackerrank – Solve me first & second

This is a summary post of first Hackerrank intruductory challenges – Solve me first, Solve me second. It is only required to select your favourite programming language. You get a template and just submit this code. Both solutions: Solve me first Solve me second Also available on my GitHub here and here. Solve me first […]

Hackerrank – A Very Big Sum

Problem Statement A description of the problem can be found on Hackerrank. Solution Read from input and sum all numbers. Same as Simple Array Sum, but you have to use bigger integer type as 32-bit integer if language does not support automatic conversion to Big Integers as default I created solution in 4 languages: Scala […]

Hackerrank – Library Fine

Problem Statement A description of the problem can be found on Hackerrank. Solution Read 2 lines and parse dates. Substract actual year, month, day and expected year, month and day. Compare values and calculate fee: – if year difference is greater than 0 theb return 10000 – if year difference is equal to 0 and […]

Hackerrank – Time Conversion

Problem Statement A description of the problem can be found on Hackerrank. Solution My solution is folllowing: After reading an input line I parsed are necessary values. hours part of the input time from 0th to index of first ‘:’ minutes part of the input time from index of first ‘:’ + 1 to index […]

Hackerrank – Simple Array Sum

Problem Statement A description of the problem can be found on Hackerrank. Solution As this challenge is in Warmup subdomain, solution is pretty easy. The only thing to do is to be able to read from input given n times and make sum of all numbers. I created solution in 4 languages: Scala Java JavaScript […]