I’ve looked up at various places and found two most common ways of dealing with STDIN in Java:
- Scanner in = new Scanner(System.in);
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
However, while trying out the above ways in various practice problems and competitions, I usually run out of time. I believe it is due to slow I/O in Java.
Can anyone please suggest me a way to possibly reduce this time? Thanks in advance!