Solution (source code)

= Solution

For an <integer partition> $\lambda=(\lambda_1,\ldots,\lambda_r)$, its <Young diagram> has $\lambda_i$ left-justified cells in row $i$. A <Young tableau> of shape $\lambda$ is a filling of its cells. Under the usual standard numbering convention, a <standard Young tableau> uses each <integer> $1,\ldots,n$ once and increases strictly along every row and down every column. For a different fixed ordered set of distinct labels, the same inequalities define the corresponding ordered-label version, which becomes standard after replacing its labels by their ranks.