use a vector to store the previous pos of queens, if queen is at [i][j], store it as map[j] = i