Created
January 30, 2018 10:05
-
-
Save clarkdo/3a39e485ddc82f6cda578854bdd73891 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Solution { | |
public int solution(int N) { | |
int A = (int)Math.round(Math.sqrt(N)); | |
while (N % A != 0) A--; | |
return 2*(A + N/A); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment