Can someone explain dis great piece of JAVA IO??

Problem Link:

Problem Solution by some gr8 Java Programmer:

Please do try to provide an elaborated answer to how IO is achieved in the Solution.

Akash Nigam.
(UP, India)


In few words: they are reading input char by char and utilized this approach to be used easily - readInt(), readString().

The goal is to have as quick reading as possible, on the other hand the code is not sensitive to such cases when line containing int contains also white spaces at the end (similar to C scanf() ).

1 Like

thanks @betlsita