Removing parenthesis from str and pushing into queue , if not visited already
temp = str . Substring ( 0 , i ) + str . Substring ( i + 1 ) ; if ( ! visit . Contains ( temp ) ) { q . Enqueue ( temp ) ; visit . Add ( temp ) ; } } } }