How can i solve the problem

thank you a lot! i got this one, but i have a more complex problem to solve.it’s kind similar to this simple problem. How can i solve this problem