Return the k-th symbol (0 or 1) in the n-th row of the grammar: S -> 0, T -> 01, S -> T|TT.
Example 1
Input: n = 1, k = 1
Output: 0
Explanation: The first string of the grammar is "0".
Output: 0
Explanation: The first string of the grammar is "0".
Example 2
Input: n = 2, k = 2
Output: 1
Explanation: The second string is "01"; the second character is 1.
Output: 1
Explanation: The second string is "01"; the second character is 1.