give array num integer consist choose element decrease 1an array a zigzag array eitherevery evenindexe element great adjacent element ie A0 A1 A2 A3 A4 or oddindexe element great adjacent element ie A0 A1 A2 A3 A4 return minimum number move transform give array nums zigzag array Example 1input num 123output 2explanation we decrease 2 0 3 1example 2input num 96162output 4 Constraints1 numslength 10001 numsi 1000