What is the mistake?

Please reply to this

Anshul, there is a slight modification in the approach you have followed. All we need to do is just store all the X and Y coordinates and then sort them. and then :

ll deltaX = 0;
for(ll i=1;i<x.size();i++){
ll diff = x[i] - x[i-1] - 1 ;
deltaX = max(deltaX,diff);
}

ll deltaY = 0;
for(ll i=1;i<y.size();i++){
    ll diff = y[i] - y[i-1] - 1 ;
    deltaY = max(deltaY,diff);
}
ll maxArea = deltaX * deltaY ;
    cout << maxArea ;

https://ide.codingblocks.com/s/297525…i have updated some but getting the compilation error…also why u taken deltaX=0 and not x[0]-1?

please reply to this

will anyone reply to this?