Hackerrank – Looping with Numbers
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 5 6 |
#!/bin/bash for i in {1..50} do echo $i done |
Solution also available on my GitHub.
My Hackerrank solutions in various domains and languages.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 5 6 |
#!/bin/bash for i in {1..50} do echo $i done |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 |
#!/bin/bash read name echo "Welcome $name" |
Solutions also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 5 6 |
#!/bin/bash for i in {1..99..2} do echo $i done |
All solutions are also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 |
#!/bin/bash echo "HELLO" |
All solutions are also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution After reading all numbers in array, you have to filter this array according to three conditions – number greater than zero, lower then zero and equals to zero. Count the subarrays and divide by array length. I created solution in 4 languages: […]
Problem Statement A description of the problem can be found on Hackerrank. Solution I created recursive function for factorial . Then create all combinations of rows and column indexes. For input 4 it looks like:
|
1 2 3 4 |
(0,0) (1,0), (1,1) (2,0), (2,1), (2,2) (3,0), (3,1), (3,2), (3,3) |
Apply function for pascal triangle for each combination. I created solution in Scala: The solution […]
This is a summary post of first Hackerrank intruductory challenges – Solve me first, Solve me second. It is only required to select your favourite programming language. You get a template and just submit this code. Both solutions: Solve me first Solve me second Also available on my GitHub here and here. Solve me first […]
Problem Statement A description of the problem can be found on Hackerrank. Solution Read from input and sum all numbers. Same as Simple Array Sum, but you have to use bigger integer type as 32-bit integer if language does not support automatic conversion to Big Integers as default I created solution in 4 languages: Scala […]
Problem Statement A description of the problem can be found on Hackerrank. Solution Read input and implement factorial function (recursive or imperative) using Big Integer if desired language does not support automatic conversion to Big Integers by default. I created solution in 3 languages: Scala Java Ruby Normally, I implement a solution also in JavaScript. […]
Problem Statement A description of the problem can be found on Hackerrank. Solution Read 2 lines and parse dates. Substract actual year, month, day and expected year, month and day. Compare values and calculate fee: – if year difference is greater than 0 theb return 10000 – if year difference is equal to 0 and […]