Pregunta de entrevista de TradingHub

Binary tree-based pair programming interview, interesting problem. Maths/brainteasers included dynamic programming and coin-flip type questions.