Um... for (int i = 0; i < k; i++)? You don't have to write enhanced for loops all day, you know, although they are cool...
And just for the sake of argument:
for (int i : range(k)) char count: 22
for (int i = 0; i < k; i++) char count: 27
Discounting the implementation of range, it is pseudo even.