Sorted Cyclic Shift Absolute Differences

Given two integer arrays nums1 and nums2, both of length n, consider every cyclic right shift t of nums1 (0 <= t < n). For each shift, compute the sum of element-wise absolute differences:...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: