Codewars - Array#second

Codewars - Problem description A description of the problem can be found on Codewars. Solution In Ruby there is a keyword self for accessing reference of an object. Correct implementations: Ruby All solutions are also available on my GitHub. Ruby

Codewars - Lexical this

Codewars - Problem description A description of the problem can be found on Codewars. Solution Add each element from f to _friends array. Correct implementations: JavaScript All solutions are also available on my GitHub. Javascript

Codewars - Broken Greetings

Codewars - Problem description A description of the problem can be found on Codewars. Solution Java - Greet return string contained parameters at wrong places, yourName should be first and name second Javascript - add this to name in greet return Ruby - prefix name with @. This is Ruby syntax for instance variables. Correct […]

Hackerrank - Divisible Sum Pairs

Hackerrank - Problem Statement A description of the problem can be found on Hackerrank. Solution Create index pairs variations for all indexes that pair is unique - it means when (i, j) exists (j, i) is the same. For each pair calculate the sum of values at corresponding index. If is divisible, count them and […]

Hackerrank - CamelCase

Hackerrank - Problem Statement A description of the problem can be found on Hackerrank. Solution There are 2 options To split the string by regular expression"[A-Z]" and then print the length of an array returned from splitting. To iterate over all characters, count the uppercase and print their count + 1 I created solution in: […]

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 […]

Codewars - Multiply

Codewars - Problem description A description of the problem can be found on Codewars. Solution There are 3 solution for each languages Java - Missing semicolon after as expression separator in function return Javascript - Missing return and semicolon in function return Ruby - Missing comma as separator in function parameters Correct implementations: Java JavaScript […]

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 […]