A staircase is an array where every element is one greater than the previous element. Convert a given array into a staircase using only increment operations. You have to return the minimum number of increment operations you'd have to do to convert the array into a staircase.
Example input -
[9, 7, 10, 8, 5]
Resulting staircase would look like -
[9, 10, 11, 12, 13]
Number of increment operations - 0 + 3 + 1 + 4 + 8 = 16
This was for a phone interview. They require you to share your screen and turn on your camera. They don't turn on their own camera which i thought was odd. You write code in a google doc.