Last active
December 25, 2015 15:25
-
-
Save gresrun/c65e9b3b99eaf718b2c2 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
public class GoNumSquares { | |
private static final int BOARD_SIZE = 19; | |
public static void main(final String... args) { | |
int squareSum = 0; | |
for (int i = BOARD_SIZE; i > 0; i--) { | |
final int dim = (BOARD_SIZE - i) + 1; | |
squareSum += (dim * dim); | |
} | |
System.out.println(squareSum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result: 2470