Skip to content

Instantly share code, notes, and snippets.

@nm3mon
Created August 22, 2013 23:01
Show Gist options
  • Save nm3mon/6313829 to your computer and use it in GitHub Desktop.
Save nm3mon/6313829 to your computer and use it in GitHub Desktop.
static int mystery(int a, int b) {
if (b == 0) return 0;
if (b % 2 == 0) return mystery(a + a, b / 2);
return mystery(a + a, b / 2) + a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment