You want to construct an array a of length n with indices from n
a[0]
The absolute difference between any two adjacent elements satisfies a[i + 1] a[i] diff[i] for all n
For each condition in restrictions, represented as idx satisfies a[idx]
Return the maximum possible value that can be achieved in the array a.
Constraints:
n
restrictions.length n
restrictions[i].length
restrictions[i]
n
diff.length n
diff[i]
The values of restrictions[i][0] are unique.
You want to construct an array a of length n with indices from n
a[0]
The absolute difference between any two adjacent elements satisfies a[i + 1] a[i] diff[i] for all n
For each condition in restrictions, represented as idx satisfies a[idx]
Return the maximum possible value that can be achieved in the array a.
Constraints:
n
restrictions.length n
restrictions[i].length
restrictions[i]
n
diff.length n
diff[i]
The values of restrictions[i][0] are unique.