You are given an integer n and a queries where each query is represented as queries[i] = [type_i, index_i, val_i].
Initially, there is a matrix of size n $ imes$ n with all elements set to
For each query:
If type_i index_i to val_i, overwriting any existing values.
If type_i index_i to val_i, overwriting any existing values.
Return the total sum of all elements in the matrix after processing all queries.
Constraints:
n
queries.length
queries[i].length
type_i
index_i n
val_i
You are given an integer n and a queries where each query is represented as queries[i] = [type_i, index_i, val_i].
Initially, there is a matrix of size n $ imes$ n with all elements set to
For each query:
If type_i index_i to val_i, overwriting any existing values.
If type_i index_i to val_i, overwriting any existing values.
Return the total sum of all elements in the matrix after processing all queries.
Constraints:
n
queries.length
queries[i].length
type_i
index_i n
val_i