swap ' _ ' with the character on it 's right this time
if ( pp < n - 1 ) { swap ( ss [ pp ] , ss [ pp + 1 ] ) ; if ( ! vis . count ( ss ) ) { if ( ss == f ) { return dist + 1 ; break ; } vis [ ss ] = dist + 1 ; q . push ( { ss , pp + 1 } ) ; } swap ( ss [ pp ] , ss [ pp + 1 ] ) ; }