please help me to solve this problem with some approach. I have tried many. Thanks in advance.