HACKEREARTH QUESTION

How to solve this question?

thanks!