Skip to content

Instantly share code, notes, and snippets.

@Chocochip101
Created January 25, 2022 05:59
int bas = (M - totalSize) / (N - 1);
int redBlank = (M - totalSize) % (N - 1);
for (int i = 1; i < N; ++i) {
if (redBlank > 0 && ('a' <= bb[i][0] && bb[i][0] <= 'z')) {
bb[i] = '_' + bb[i];
redBlank--;
}
}
for (int i = N - 1; i > 0; --i) {
if (redBlank > 0 && 'A' <= bb[i][0] && bb[i][0] <= 'Z') {
bb[i] = '_' + bb[i];
redBlank--;
}
}
for (int i = 1; i < N; ++i)
for (int j = 0; j < bas; ++j)
bb[i] = '_' + bb[i];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment