you give binary string s in second occurrence 01 simultaneously replace 10 this process repeat occurrence 01 existreturn number second need complete process Example 1input s 0110101output 4explanation after second s 1011010after second s 1101100after second s 1110100after fourth second s 1111000no occurrence 01 exist long process need 4 second completeso return 4example 2input s 11100output 0explanationno occurrence 01 exist s process need 0 second completeso return 0 Constraints1 slength 1000si 0 1 Follow upcan solve problem on time complexity