Hackerrank – ‘Grep’ #2
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 |
#!/bin/bash grep -i "\bthe\b" |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 |
#!/bin/bash grep -i "\bthe\b" |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 |
#!/bin/bash grep "\bthe\b" |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 5 6 7 8 9 |
#!/bin/bash read letter if [[ ("$letter" == "y") || ( "$letter" == "Y" ) ]]; then echo "YES" elif [[ ("$letter" == "n") || ( "$letter" == "N" ) ]]; then echo "NO" fi |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution I created solution in: Bash All solutions are also available on my GitHub. Bash
|
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/bash read x read y if ((x < y)); then echo "X is less than Y" elif ((x > y)); then echo "X is greater than Y" else echo "X is equal to Y" fi |
Problem Statement A description of the problem can be found on Hackerrank. Solution
|
1 2 3 4 5 6 7 8 9 |
#!/bin/bash read x read y echo $[$x + $y] echo $[$x - $y] echo $[$x * $y] echo $[$x / $y] |
Solution 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..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: […]