Google interview question

How to solve mathematical problem