you string s consist n character each character 0 1you perform operation string each operation consist step select integer 1 length string s delete character s_i string length gets reduce 1 index character right delete reduce 1 string s delete maximum length prefix consist character indice remain character string length reduce length delete prefix Note step mandatory operation order changedFor example string s 111010 operation follow select 1 111010 rightarrow 11010 rightarrow 010 select 2 111010 rightarrow 11010 rightarrow 010 select 3 111010 rightarrow 11010 rightarrow 010 select 4 111010 rightarrow 11110 rightarrow 0 select 5 111010 rightarrow 11100 rightarrow 00 select 6 111010 rightarrow 11101 rightarrow 01 you finish perform operation string s what maximum number operation perform