3468. Find the Number of Copy Arrays
You are given an array
original
of lengthn
and a 2D arraybounds
of lengthn x 2
, wherebounds[i] = [ui, vi]
.You need to find the number of possible arrays
copy
of lengthn
such that:
(copy[i] - copy[i - 1]) == (original[i] - original[i - 1])
for1 <= i <= n - 1
.ui <= copy[i] <= vi
for0 <= i <= n - 1
.Return the number of such arrays.
c++
1 | class Solution { |