loading...

re: Master Java: Basics. 🚀 VIEW POST

FULL DISCUSSION
 

I know it's early to ask but can you tell me how to create a user defined 'FastReader class'.
I want to use it because Scanner class takes a lot of time resulting in time limit exceed in competitive programming and BufferReader class is also never recommended in competitive programming because of its complexity.

 

Hey Parth! When it comes to competitive programming, if you are ending up with TLE, try to optimize the time complexity by changing the approach of solving the problem, but if you are not able to do that, then you can use the FastReader class, I will be writing the article on it soon. Meanwhile do refer to the article given by Mohamed given in the comments!

PS - it is always better to use Scanner class since fast I/O methods make your program very lengthy. And these type of questions are really rare and won't be asked in interviews as such!

 

Thank you Raksha! :)

 

While the author replies, check out the geeks-for-geeks post about this: geeksforgeeks.org/fast-io-in-java-...

 

Thanks Mohamed Moustafa :)

Code of Conduct Report abuse