The first row of a table is 0. To produce the next row, replace every 0 with 01 and every 1 with 10, keeping their order. Return the symbol at position k in row n. Both rows and positions are numbered starting at 1.
Example 1:
Input: n = 3
k = 3
Output: 1Explanation: Row 3 is 0110, whose third symbol is 1.
Example 2:
Input: n = 4
k = 5
Output: 1Explanation: Row 4 is 01101001, so its fifth symbol is 1.
Example 3:
Input: n = 4
k = 8
Output: 1Explanation: The eighth and final symbol of row 4, 01101001, is 1.
Constraints:
1 <= n <= 301 <= k <= 2^(n - 1)