Hackerrank – Project Euler+ #003 – Largest prime factor

Hackerrank – Problem description The problem description – Hackerrank. Solution We can use the algorithm where we find out a list of all prime number divisor – prime factorization. Let find the beginning prime number. The smallest prime number is 2. We divide the given number with actual divisor (actual prime number) until the division […]

Hackerrank – Project Euler+ #002 – Even Fibonacci numbers

Hackerrank – Problem description The problem description – Hackerrank. Solution We will calculate Fibonacci numbers sequence using known algorithm. If the next number is even, add it to the result sum. We end up calculations when the next Fibonacci number is greater than upper number constraint. I created solution in: Ruby All solutions are also […]

Hackerrank – Project Euler+ #001 – Multiples of 3 and 5

Hackerrank – Problem description The problem description – Hackerrank. Solution There is N defined as the maximum constraint. We could start from 3 to N and sum all numbers divisible by 3 and 5 (using modulo operation). Unfortunately this is not correct solution, because there are some numbers which are summed 2 times. These numbers […]

Hackerrank – Grading Students

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution We will use professor’s rules and transform all grades: – We find how many times (n) is 5 in given grade – if it is divisible without a remainder, we do nothing – it not we round it to neareast […]

Hackerrank – Between Two Sets

Hackerrank – Problem description The problem description – Hackerrank. Solution I created an array of all positive numbers, which satisfy conditions specified in problem statement. This set should contain elements from to . I filter all numbers from the set that are valid for an equation a . The array of positive numbers can be […]

Hackerrank – The Hurdle Race

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution We need to find the highest hurdle. If it is greater than k then substract its height with k and we have the result. Otherwise print 0. I created solution in: Scala Java JavaScript Ruby All solutions are also available […]