

I only managed to capture photos of one problem; the other was an easier one. Apologies for the blurry images, but these were the best I could get since it was a proctored test.
Problem Description:
Given two arrays: array a (length n) and array b (length n+1)
Three allowed operations:
Increase any element of array a by 1
Decrease any element of array a by 1
Copy any element of array a and append it to the end
Goal: Find the minimum number of operations needed to transform array a into array b
P.S output of the second test case is 8
Please post the solution if you know