Google interview question

A coding contest over hackerearth