This problem was asked recently in Atlassian OA.
Given an array ; in 1 operation you can add + 1 to any element of the array
This operation costs c[i] if you perform this operation on element at index "i"
Find minimum cost to make all array elements distinct
1<=N<=100000
1<=A[i]<=1000000000
1<=c[i]<=100000
Input —
A — [1 2 2] C — [1 100 500]
O/P — 100 — Do +1 operation on second element making the array — [1 3 2]