Given a string, find start and end positions of all smiles in string. Each smile starts with “:-” and then an unlimited number of “)” or “(” could go. Remove found smiles. And don't forget to check if new smiles have appeared in string (example - ':-:-)(' ). Do it optimally!
Given a string, find start and end positions of all smiles in string. Each smile starts with “:-” and then an unlimited number of “)” or “(” could go. Remove found smiles. And don't forget to check if new smiles have appeared in string (example - ':-:-)(' ). Do it optimally!