Attempting to solve the "Lonely Integer" problem
My solution
declare -i n
read n
declare -a numbers
read numbers
n=${#numbers[@]}-1
while [ $n -ge 0 ]; do echo "${numbers[$n]}\n"; ((n--)); done | sort -n | uniq -u
Except the bash on the HackerRank IDE which is 5.2.32 ( tested with bash --version ) throws the following error
P.S. ( When I tested the script on my end I used the shebang #!/bin/bash, the IDE does not require that, please don't say that is the solution )


[doesn't do arithmetic.1-1isn't a valid number.read numberswill not read each number into a different element of the array. See stackoverflow.com/questions/9293887/…n=$((${#numbers[@]}-1))to perform arithmetic inbash.declare -icausesn=1-1to do arithmetic evaluation, but the target system does not. More minimal example:declare -i n; n=1-1; echo $n. I think you can reduce this question greatly (and get rid of the images).declare -ihas been used.