Find The Number Hackerrank Solution Javascript