Grand temple ? i have tried this code for sample input given and it shows correct answer please tell me what i am doing wrong
@sarthaksingh
Your approach a bit sideways afterwards. After you have made the difference arrays - diffx and diffy , just find the max element out of each of them. We know max area will be where there is largest gap between x and y intersection points. So just find that and multiply them.
maxArea = maxOf_diffx * maxOf_diffy ;