Given an array of integers, you can only choose one number to modify each time. You can add 1 for odd-numbered operations, and add 2 for even-numbered operations or also skip. What are the minimum number of operations you can perform to make all the elements of the array the same?
Example: [3,2,2] = 3 operations
1.[3,3,2] Add 1 to index 1
2.Skip
3.[3,3,3] Add 1 to index 2
Can anyone solve this?