you give 0indexed binary string target length n you binary string s length n initially set zero you want s equal targetin operation pick index 0 n flip bit inclusive range n 1 Flip mean change 0 1 1 0return minimum number operation need s equal target example 1input target 10111output 3explanation initially s 00000choose index 2 00000 00111choose index 0 00111 11000choose index 1 11000 10111we need 3 flip operation form targetexample 2input target 101output 3explanation initially s 000choose index 0 000 111choose index 1 111 100choose index 2 100 101we need 3 flip operation form targetexample 3input target 00000output 0explanation we need operation initial s equal target Constraintsn targetlength1 n 105targeti 0 1