Can you envisage an algorithm running in linear time?
Bhaskar Bantupalli wrote:. . . . Which API do you recommend that works for java 8 and 8+ alike
I would use a Scanner to read System.in. It does its own tokenising which makes it unnecessary to use the tokeniser. It also provides methods like
nextInt() which make it unnecessary to use Integer.parseInt() or similar.
For other input, use a Path object, as described in the
Java™ Tutorials.
. . . Can you say what the other forum is?
Java in General.