PROJECT EULER · #0923
Young's Game B
A Young diagram is a finite collection of (equally-sized) squares in a grid-like arrangement of rows and columns, such that
- the left-most squares of all rows are aligned vertically;
- the top squares of all columns are aligned horizontally;
- the rows are non-increasing in size as we move top to bottom;
- the columns are non-increasing in size as we move left to right.
Two examples of Young diagrams are shown below.

Two players Right and Down play a game on several Young diagrams, all disconnected from each other. Initially, a token is placed in the top-left square of each diagram. Then they take alternating turns, starting with Right. On Right's turn, Right selects a token on one diagram and moves it one square to the right. On Down's turn, Down selects a token on one diagram and moves it one square downwards. A player unable to make a legal move on their turn loses the game.
For

Additionally, define the weight of an
Let
For example,

You are also given
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.