So here is the problem I am facing, for the problem --> 1827A - Counting Orders, I am getting AC when using a solution using arrays, and getting a TLE when using ArrayList.
Here are the two solutions: using Array --> 278615778 using ArrayList --> 278616942
So tell me whether I should use ArrayList or Arrays for solving problems because this is not the only problem where I have faced this issue, there were others also.
Can anyone who has experience using Java tell me whether I should use ArrayList or Arrays?