• + 0 comments

    finding the solution for this question is not the problem, but trying to understand.

    tips if it helps,

    You need two array:

    • n dimensional for storing the result of query 1 section.
    • temporary arr for storing lastanswer generated from query 2 section.

    What are queries: example of provided sample data

    • n=2 #query=5
    • 1 0 5 = query 1, x=0, y=5
    • 1 1 7 = query 1, x=1, y=7
    • 1 0 3 = query 1, x=0, y=3
    • 2 1 0 = query 2, x=1, y=0
    • 2 1 1 = query 2, x=1, y=1