you give 0indexed array num consist n positive integersThe array num call alternate ifnumsi 2 numsi 2 n 1numsi 1 numsi 1 n 1in operation choose index change numsi positive integerreturn minimum number operation require array alternate Example 1input num 313243output 3explanationone way array alternate convert 313131the number operation require case 3it prove possible array alternate 3 operation Example 2input num 12222output 2explanationone way array alternate convert 12121the number operation require case 2note array convert 22222 case nums0 nums1 violate condition alternate array Constraints1 numslength 1051 numsi 105