you give string s consist character you perform process stre this process describe follow pseudocode re 0for init 0 inf cur init ok true 1 s res re 1 si cur cur 1 cur cur 1 cur 0 ok false break ok breakNote inf denote infinity character string number 1 sYou calculate value res process end