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