enter image description here
There are some examples with answers in this image. How they get the answers. Please explain the steps.