They have asked for number of walks that may or may not pass through P. Basically they are asking for total number of walks possible from A to B.
From A to B we have to take $6$ right steps and $5$ up steps.
Notice we can take right and up steps in any order and we will reach B at the end.
So there are total $11 (5+6)$ steps to take.
Choosing $6$ positions (for right steps) right among $11$ positions = $11\choose6$ $= \frac{11!}{5!*6!} = 462$
OR we can also choose $5$ positions for up steps and putting right on the remaining positions answer will still be the same.