Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One can get easily get cells under the path from to_area_sequence(). For example:

dw = DyckWord([1,1,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,0])
A = [ (j,i) for i,J in enumerate(dw.to_area_sequence()) for j in range(J) ]
assert len(A) == dw.area()
print(A)

gives

[(0, 1), (0, 2), (1, 2), (0, 3), (1, 3), (0, 4), (1, 4), (2, 4), (0, 5), (1, 5), (2, 5), (3, 5), (0, 6), (1, 6), (0, 7), (1, 7), (2, 7), (0, 8), (1, 8)]