Skip to content

Instantly share code, notes, and snippets.

@gsmcwhirter
Last active October 12, 2015 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsmcwhirter/beb19e60022dd2fe67fc to your computer and use it in GitHub Desktop.
Save gsmcwhirter/beb19e60022dd2fe67fc to your computer and use it in GitHub Desktop.
public int mystery(int n)
{
int a = 0, b = 1;
while (n > 0)
{
n--;
b = b+a;
a = b-a;
if ((a + b) % 13 == 0)
{
return n;
}
}
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment