Skip to content

Instantly share code, notes, and snippets.

@jononon
Last active June 5, 2016 19:42
Show Gist options
  • Select an option

  • Save jononon/91acc84519d9c54dbdf3 to your computer and use it in GitHub Desktop.

Select an option

Save jononon/91acc84519d9c54dbdf3 to your computer and use it in GitHub Desktop.
//Returns the number of factors of x, starting at n
public int mystery (int n, int x) {
return (n<x)?((int) n%x==0)+mystery(n+1, x):0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment