Hackerrank – ‘Tr’ Command #1
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 |
#!/bin/bash tr "(" "[" | tr ")" "]" |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 |
#!/bin/bash tr "(" "[" | tr ")" "]" |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 3 |
#!/bin/bash head -c 20 |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 3 |
#/bin/bash head -n 20 |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 3 |
#!/bin/bash cut -c2,7 |
Solution also available on my GitHub.
Problem Statement A description of the problem can be found on Hackerrank. Solution
1 2 3 |
#!/bin/bash cut -c3 |
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.