Flipkart Interview Question

Burning Tree problem was asked with its variations.