whats wrong with my script?
#!/usr/bin/env bash
declare input="$@"
[ "${#input}" -le 1 ] && { echo false; exit; }
input="${input// /}"
[[ "$input" =~ ^[0-9]+$ ]] || { echo false; exit; }
declare -i counter=0
declare -i sum=0
declare -i digit=0
while [ "$counter" -lt "${#input}" ]; do
digit=${input:$counter:1}
((counter++%2 == 0)) && { ((digit+digit > 9)) && ((sum+=digit+digit-9)) || ((sum+=digit+digit)); } || \
((sum+=digit))
done
((sum%10 == 0)) && echo true || echo false
Locally I can pass most tests but when Im run testing in exercism I
m failing 5 tests only about SIN. I followed all the instructions and examples in the question.