How can we solve the problem like this