Input: arr[] = {5, 3, 2, 5}
Output: 3
Explanation: First operation: [5, 3, 2, 5]?[5, 3, 3, 5]
Second operation: [5, 3, 3, 5]?[5, 4, 4, 5]
Third operation: [5, 4, 4, 5]?[5, 5, 5, 5]
Hence, the minimum operations required will be 3
Input: arr[] = {1, 2, 3, 5, 3}
Output: 2
Explanation: First operation: [1, 2, 3, 5, 3] -> [1, 2, 3, 5, 4]
Second operation: [1, 2, 3, 5, 4] -> [1, 2, 3, 5, 5]
Hence, the minimum operations required will be 2