We build a table of N rows. The first row is 0. For every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10. Given N and K, find the K-th (1-indexed) symbol in the N-th row.
{
"n": 1,
"k": 1
}0{
"n": 2,
"k": 1
}0{
"n": 2,
"k": 2
}1Sign in to Run Code and Submit