if the movement is towards left then we move left . The start variable and mark that position as visited if not visited previously . Else we break out
if ( s == " " ) { if ( mark [ start ] == 0 ) { mark [ start ] = 1 ; start -= a [ start ] ; }