Removing parenthesis from str and pushing into queue , if not visited already
temp = str [ 0 : i ] + str [ i + 1 : ] NEW_LINE if temp not in visit : NEW_LINE INDENT q . append ( temp ) NEW_LINE visit . add ( temp ) NEW_LINE DEDENT