eClerx interview question

a mathematical puzzle