Getting the length of arr is enough to reach the time limit on testcase 29
This does not apply to C++, Java and others