Please help me on this, i am unable to solve this logic