Hacker News new | ask | show | jobs
by shenberg 159 days ago
You always either go left or down so total 40 steps, choose 20 to be down (or 20 to be right)
1 comments

Which suggests another approach to the solution; you have 20Ls and 20Rs which can appear in any order so it’s a permutation with repetition problem and thus 40!/(20!20!)

That approach has the advantage that it’s easily adapted to non square rectangular grids (n+m)!/(n!m!)