Possibly the hardest question I have seen in a really long time
Couldn’t solve it on my own
Needed knowledge of monotonic stacks which I haven’t done since last year might refresh on this topic and do a medium level problem