Skip to content

Instantly share code, notes, and snippets.

@kimki1124
Last active August 6, 2017 12:22
Show Gist options
  • Save kimki1124/318c69acd2ccd47263f9b700372a33cf to your computer and use it in GitHub Desktop.
Save kimki1124/318c69acd2ccd47263f9b700372a33cf to your computer and use it in GitHub Desktop.
public static long bestPractice(long m) {
long mm = 0, n = 0;
while (mm < m)
mm += ++n * n * n;
return mm == m ? n : -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment