Remix.run Logo
dhosek 4 hours ago

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!)