ServiceNow OA
Anonymous User
2326

Given two arrays A[] and B[] of length N, the task is to find the minimum number of operations in which the array A can be converted into array B where each operation consists of adding an integer K into a subarray from L to R.

The idea is to count the consecutive elements, in array A, having an equal difference with the corresponding element in array B.

Comments (2)