Skip to content

Instantly share code, notes, and snippets.

@arrbxr
Created February 18, 2018 18:01
Show Gist options
  • Save arrbxr/5ddab552cdcd3123f61e1edac4c8b2e8 to your computer and use it in GitHub Desktop.
Save arrbxr/5ddab552cdcd3123f61e1edac4c8b2e8 to your computer and use it in GitHub Desktop.
Find the next perfect square! created by arrbxr - https://repl.it/@arrbxr/Find-the-next-perfect-square
function findNextSquare(sq){
for(var i = 1; i<=sq; i++){
if(i * i == sq){
i++;
return i*i;
}
}
return -1;
}
findNextSquare(319225);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment