Created
October 24, 2014 10:45
-
-
Save anton0xf/5af0cb1258e695bec76b 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 static int[] arrange(int m, int n) { | |
| int res[] = new int[m]; | |
| if (n > 0) { | |
| int s = 0; | |
| for (int i = m - 1; i >= 0; i--) { | |
| s += n; | |
| if (s >= m) { | |
| res[i]++; | |
| s -= m; | |
| } | |
| } | |
| } | |
| return res; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment