Need approach

Can anyone tell me how to solve this and this ?

Can you please also explain the approach?