Hackerrank – Handshake

Problem Statement A description of the problem can be found on Hackerrank. Solution     I created solution in: Java JavaScript Ruby Scala All solutions are also available on my GitHub. Java

JavaScript

Ruby

Scala

Hackerrank – Halloween Party

Problem Statement A description of the problem can be found on Hackerrank. Solution Calculate chocolate pieces as:             I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. Java

JavaScript

Scala

Ruby

Hackerrank – HackerRank Tweets

Problem Statement A description of the problem can be found on Hackerrank. Solution Check if every line in lowercase matches this regex pattern: .*hackerrank.* I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. Java

JavaScript

Scala

Ruby

Hackerrank – Gemstones

Problem Statement A description of the problem can be found on Hackerrank. Solution Do intersect of all characters of strings comming as the input. I created solution in: Java JavaScript Ruby Scala All solutions are also available on my GitHub. Java

JavaScript

Ruby

Scala

Hackerrank – Game of Thrones – I

Problem Statement A description of the problem can be found on Hackerrank. Solution Palindrome is when: if the length of a string is even, then each character needs to be even times in the string if the length of a string is odd, then there is only one character, which count in the string is […]

Hackerrank – Funny String

Problem Statement A description of the problem can be found on Hackerrank. Solution For index i in string s check if all differences are equals:     I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. Java

JavaScript

Scala

Ruby

Hackerrank – Flowers

Problem Statement A description of the problem can be found on Hackerrank. Solution Sort all prices descending. The formula for calculating the flower i in prices: $$total = \sum_{i=0}^{n-1}((i / k + 1) * price_{i})$$ I created solution in: Java JavaScript Ruby Scala All solutions are also available on my GitHub. Java

JavaScript

[…]

Hackerrank – Flipping Bits

Problem Statement A description of the problem can be found on Hackerrank. Solution Define maximum unsigned int in binary as: 11 111 111 111 111 111 111 111 111 111 111. For all input number XOR with maximum and print the output. Aware that some programming languages have signed numbers. It is better to use […]

Hackerrank – Find Point

Problem Statement A description of the problem can be found on Hackerrank. Solution For solution you can check wikipedia page for Point reflection. I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. Java

JavaScript

Scala

Ruby

Hackerrank – Find Hackerrank

Problem Statement A description of the problem can be found on Hackerrank. Solution Print “0” if the input matches ^hackerrank$ or ^hackerrank.*hackerrank$ Print “1” if the input matches ^hackerrank.* Print “2” if the input matches .*hackerrank$ else print “-1” I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. […]