Last active
August 6, 2017 12:22
-
-
Save kimki1124/318c69acd2ccd47263f9b700372a33cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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