Input: N=10, q[] = {{1, 5, 3}, {4, 8, 7}, {6, 9, 1}}
Output: 10
Explanation:
Initially the array is ? [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Query1 {1, 5, 3} results in [3, 3, 3, 3, 3, 0, 0, 0, 0, 0]
Query2 {4, 8, 7} results in [3, 3, 3, 10, 10, 7, 7, 7, 0, 0]
Query2 {6, 9, 1} results in [3, 3, 3, 10, 10, 8, 8, 8, 1, 0]
Maximum value in the updated array = 10