You are given an integer array nums, an integer k, and a queries where each query is given in the form queries[i] = [index_i, value_i, start_i, x_i].
For each query in order, perform the following actions:
Update nums[index_i] to value_i. This modification persists for all subsequent queries.
Count the number of subarrays starting at index start_i (that is, contiguous subarrays nums[start_i..j] where start_i nums.length) such that the product of the elements in the subarray modulo k is equal to x_i.
Return an integer array containing the result for each query.
Constraints:
nums[i]
nums.length
k
queries.length
queries[i] == [index_i, value_i, start_i, x_i]
index_i nums.length
value_i
start_i nums.length
x_i k
You are given an integer array nums, an integer k, and a queries where each query is given in the form queries[i] = [index_i, value_i, start_i, x_i].
For each query in order, perform the following actions:
Update nums[index_i] to value_i. This modification persists for all subsequent queries.
Count the number of subarrays starting at index start_i (that is, contiguous subarrays nums[start_i..j] where start_i nums.length) such that the product of the elements in the subarray modulo k is equal to x_i.
Return an integer array containing the result for each query.
Constraints:
nums[i]
nums.length
k
queries.length
queries[i] == [index_i, value_i, start_i, x_i]
index_i nums.length
value_i
start_i nums.length
x_i k