Pergunta de entrevista da empresa Citi

Coin toss problem. How to derive OLS closed-form solution.