Hello there
I'm trying to solve this problem
So i was thinking if i create a segment tree where each node has a segment tree that would do the trick
I've heard about 2D segment tree before but never implemented it
the only way i could think off would definitely get me MLE where i do an array seg[n*2][n*2]
if anybody has any tricks that could save memory or maybe the correct way for creatin a 2D segment tree that would be really appreciated :D