TLE Error for 3 testcases

3 test cases are showing TLE whereas all the other testcases respond correct answer

@namangarg2000 you need to use an optimized approach to fill your l and r array, using nested for loop will give you TLE.