Skip to content

Instantly share code, notes, and snippets.

@stephen-maina
Created May 3, 2015 18:09
Show Gist options
  • Save stephen-maina/ba59ccfd8bdcee465d73 to your computer and use it in GitHub Desktop.
Save stephen-maina/ba59ccfd8bdcee465d73 to your computer and use it in GitHub Desktop.
class Solution {
public int solution(int N) {
// write your code in Java SE 8
int fac=0;
int count=0;
for(int index=(int)Math.sqrt(N);index>0;index--){
fac=N/index;
if(fac*index==N){count=count+2;
if(fac==index){count-=1;}}
}
return count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment