Problem -subarrays again

only 4 test case pass
2 shows TLE
1 shows wrong answer

bhaiya please help how i solve it.

hello @Raja42724
in which question u have doubt?
please mention its name .

problem name-subarrays again
on hackerblock

can u please share its link

https://hack.codingblocks.com/app/practice/1/584/problem

image

here it should be >=

u r getting tle because ur solution is o(n^2).

try to think of o(n) approach.

ok bhaiya thanku i will try

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.