it's literally either minimum subarray or you have to know monotonic queue, yeah, sure buddy, great fucking problem, shows your inteligence level perfectly... you just have to know one of the above
how the fuck was I supposed to know you need to take a mininum subarray..... I didn't fucking know what minimum subarray is bro FUCK