Can someone explain dis great piece of JAVA IO??

Problem Link: CodeChef: Practical coding for everyone

Problem Solution by some gr8 Java Programmer: CodeChef: Practical coding for everyone

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

Regards,
Akash Nigam.
(UP, India)

Waiting…:expressionless:

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