Hackerrank – Alien Username

Problem Statement A description of the problem can be found on Hackerrank. Solution Regular Expression that validates input username: ^[_\.]\d+[a-zA-Z]*_?$ I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. Java

JavaScript

Scala

Ruby

Hackerrank – Chocolate Feast

Problem Statement A description of the problem can be found on Hackerrank. Solution Calculate count of chocolates: chocolates = money / price . Count of chocolates is count of wrappers, too. Free chocolates are calculated: divide chocolates with count of chocolates needed for discount add solution of the division to chocolates new wrappers count is: […]

Hackerrank – Cavity Map

Problem Statement A description of the problem can be found on Hackerrank. Solution Filter all matrix indexes that are at the periphery. For all the rest choose one index and compare its value with all neighbours (left, right, up, down). If it is greater than all neighbours, replace it with ‘X’. I created solution in […]

Hackerrank – Service Lane

Problem Statement A description of the problem can be found on Hackerrank. Solution Find minimum in given array from index i to j. I created solution in 4 languages: Scala Java JavaScript Ruby All solutions are also available on my GitHub. Scala

Java

JavaScript

Ruby

Hackerrank – Encryption

Problem Statement A description of the problem can be found on Hackerrank. Solution Calculate a width and height of a required matrix: height = ceil(length(input_string) width = floor(length(input_string) Then create a height x width matrix containing a characters from input_string. Transpose the matrix and print all rows. Node: Instead we can print all columns of […]

Ad Infinitum 13 – Math Programming Contest

Hackerrank organized another programming contests from 23.10.2015 17:30 CEST to 25.10.2015 CET called Ad Infinitum 13 – Math Programming Contest, which I participaded in. It was my 12th contest at Hackerrank and I think I was quite successfull. I was able to solve 3 challenges and earned full points: Game with coins Integral Points The […]

Hackerrank – Evaluating e^x

Problem Statement A description of the problem can be found on Hackerrank. Solution

Solution also available on my GitHub.

Hackerrank – Update List

Problem Statement A description of the problem can be found on Hackerrank. Solution

Solution also available on my GitHub.

Hackerrank – List Length

Problem Statement A description of the problem can be found on Hackerrank. Solution

Solution also available on my GitHub.

Hackerrank – Sum of odd elements

Problem Statement A description of the problem can be found on Hackerrank. Solution

Solution also available on my GitHub.