The picture seems to demonstrate an ambiguous problem with 2 possible answers.
We're given that Ram is 18th from the left end of the row, and Sumit is 23rd from the right end, and that there are 5 other boys in between Ram and Sumit.
It is possible that Ram is to the left of Sumit, with 5 boys in between, and there are 18+5+23 = 46 boys in the row. This is the non-overlapping answer because the 17 boys to the left of Ram don't include Sumit, and the 22 boys to the right of Sumit don't include Ram.
The row looks like this (where R = Ram, and S = Sumit).
.................R.....S......................
However, there is a 2nd answer, because it is possible that Ram is to the right of Sumit, with 5 boys in between. This is the overlapping answer, because Sumit is among the 17 boys to the left of Ram, and Ram is among the 22 boys to the right of Sumit.
In this case, the number of boys in the row equals 18 + 23 - 5 - 2 = 34.
...........S.....R................