Solution of the problems on the hackerearth