Grand temple question

I am not able to solve because the dimensions of matrix is not given so how should I approach?

Hello @dsingh200021,

There is no requirement to form the matrix to solve this problem.
Surprised?

Yes, Observe the figure given in the question very carefully.

Approach:

  1. Make two vectors:
    1.1. first: to store the x coordinates provided as input.
    1.2. second: to store all the y coordinates provided as input.

  2. Sort both the vectors.

  3. Find the maximum difference between the adjacent elements of each vector as dx and dy.

  4. Print the Area by multiplying both the differences.

Note: Observe the figure carefully, you have to subtract 1 from both dx and dy before multiplication.

Hope, this would help.
Give a like, if you are satisfied.