Skip to content

Instantly share code, notes, and snippets.

@youngdo212
Created July 10, 2018 06:50
Show Gist options
  • Save youngdo212/bab8e477635d4ffd689c7274909c9460 to your computer and use it in GitHub Desktop.
Save youngdo212/bab8e477635d4ffd689c7274909c9460 to your computer and use it in GitHub Desktop.
function solution(n) {
let result = 0;
for(let i = 1; i <= n; i++){
let temp = 0;
for(let j = i; temp < n; j++){
temp += j;
}
if(temp === n) result++;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment