Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
84
Task/Catamorphism/Excel/catamorphism.excel
Normal file
84
Task/Catamorphism/Excel/catamorphism.excel
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
FOLDROW
|
||||
=LAMBDA(op,
|
||||
LAMBDA(a,
|
||||
LAMBDA(xs,
|
||||
LET(
|
||||
b, op(a)(HEADROW(xs)),
|
||||
|
||||
IF(1 < COLUMNS(xs),
|
||||
FOLDROW(op)(b)(
|
||||
TAILROW(xs)
|
||||
),
|
||||
b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
updatedBracketDepth
|
||||
=LAMBDA(depth,
|
||||
LAMBDA(c,
|
||||
IF(0 <= depth,
|
||||
IF("[" = c,
|
||||
1 + depth,
|
||||
IF("]" = c,
|
||||
depth - 1,
|
||||
depth
|
||||
)
|
||||
),
|
||||
depth
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
bracketCount
|
||||
=LAMBDA(a,
|
||||
LAMBDA(c,
|
||||
IF(ISNUMBER(FIND(c, "[]", 1)),
|
||||
1 + a,
|
||||
a
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
HEADROW
|
||||
=LAMBDA(xs,
|
||||
LET(REM, "The first item of each row in xs",
|
||||
|
||||
INDEX(
|
||||
xs,
|
||||
SEQUENCE(ROWS(xs)),
|
||||
SEQUENCE(1, 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
TAILROW
|
||||
=LAMBDA(xs,
|
||||
LET(REM,"The tail of each row in the grid",
|
||||
n, COLUMNS(xs) - 1,
|
||||
|
||||
IF(0 < n,
|
||||
INDEX(
|
||||
xs,
|
||||
SEQUENCE(ROWS(xs), 1, 1, 1),
|
||||
SEQUENCE(1, n, 2, 1)
|
||||
),
|
||||
NA()
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
CHARSROW
|
||||
=LAMBDA(s,
|
||||
MID(s,
|
||||
SEQUENCE(1, LEN(s), 1, 1),
|
||||
1
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue