Hackerrank – Caesar Cipher

Problem Statement A description of the problem can be found on Hackerrank. Solution Create a function for encrypting which takes a cipher shift as parameter as well. Check if incoming character is letter. If is lower case encrypt it using ascii number: to_char[ascii_of_char – asci_of_a + shift) % 26 + ascii_of_a]. Similar if letter is […]

Hackerrank – Java If-Else

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

Hackerrank – Arrays- DS

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

JavaScript

Scala

Ruby

Hackerrank – Welcome To Java!

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

Hackerrank – Valid PAN Format

Problem Statement A description of the problem can be found on Hackerrank. Solution Regex: [A-Z]{5}\d{4}[A-Z] I created solution in: Ruby Java JavaScript Scala All solutions are also available on my GitHub. Ruby

Java

JavaScript

Scala

Hackerrank – Utopian Tree

Problem Statement A description of the problem can be found on Hackerrank. Solution Make a height and initialize its value as 1. For each input number: if it is even double the height if it odd add 1 to height. I created solution in: Java JavaScript Scala Ruby All solutions are also available on my […]

Hackerrank – Two Arrays

Problem Statement A description of the problem can be found on Hackerrank. Solution Sort two arrays. array1 ascending, array2 descending. Add each ith element in both array and compare if their sum is greater or equals than required amount. I created solution in: Java JavaScript Scala Ruby All solutions are also available on my GitHub. […]

Hackerrank – The Love-Letter Mystery

Problem Statement A description of the problem can be found on Hackerrank. Solution For an element at index i create sum of differences between an ordinal number of character at index length(s)-i-1 and an ordinal number of the character at index i. I created solution in: Java Ruby JavaScript Scala All solutions are also available […]

Hackerrank – The British and American Style of Spelling

Problem Statement A description of the problem can be found on Hackerrank. Solution For each word in each sentence check if the word contains “ze” (US) or “se” (UK). I created solution in: Scala Ruby JavaScript Java All solutions are also available on my GitHub. Scala

Ruby

JavaScript

Java

Hackerrank – Split the Phone Numbers

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

Java

JavaScript

Ruby