you n super washing machine line initially wash machine dress emptyfor choose m 1 m n washing machine pass dress washing machine adjacent washing machine timeGiven integer array machine represent number dress washing machine leave right line return minimum number move washing machine number dress if possible return 1 example 1input machine 105output 3Explanation1st 1 0 5 1 1 42nd 1 1 4 2 1 33rd 2 1 3 2 2 2example 2input machine 030output 2explanation1st 0 3 0 1 2 02nd 1 2 0 1 1 1example 3input machine 020output 1explanationits impossible washing machine number dress Constraintsn machineslength1 n 1040 machinesi 105