Please anybody tell my mistake . Do not go in function algorithm. Please tell me that maximum value will be when we will move first from (x1,y1) —> (x1,y2) straight down and then (x1,y2)----> (x2,y2) straight right.
Not going into your “function algorithm”, I think you first have to move down and then to the right. Which means, from (x1, y1) to (x2, y1) and then from (x2, y1) to (x2, y2).
Ok i read wrong question …Thank You Bro