
A single line containing two space-separated integers, n and k.
Print a single character, either 'M' or 'F', representing the gender of the individual at the specified location.
Level n of the tree contains 2^(n-1) individuals.
Building the tree or the string for a large n is not feasible due to memory and time constraints. The solution must use the recursive structure of the problem to work backwards from the target position to the root.
The first half of any level is an exact copy of the previous level. The second half of any level is an inverted copy of the previous level (M becomes F, F becomes M).
Sorted Doubly Linked List to Balanced BST
Longest Substring with K-Repeating Characters
Expression Add Operators
Gray Code Transformation
Count of Subsequences with Given Sum