When two values given a,b then
Number of numbers between a,b (including extreme values) = a-b+1
Number of numbers between a,b (excluding extreme values) = a-b-1
From question,
1,2,3…….7position………23positon……..Last position[L]
We can write as
(23-7)-1=(L-23)-1 [ becoz the person exactly between me(L) and my friend(7position) is on the 23rd position ]
15=L-24
L=39(Answer)