[N-Queue] DFS&Bitwise solution.