Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INVESTIGATE: How to spell the D2 combinator #33

Closed
codereport opened this issue Mar 11, 2024 · 1 comment
Closed

INVESTIGATE: How to spell the D2 combinator #33

codereport opened this issue Mar 11, 2024 · 1 comment
Assignees
Labels
investigate This doesn't seem right

Comments

@codereport
Copy link
Owner

While trying to solve Leetcode 3074. Apple Redistribution into Boxes, couldn't figure out how to spell the D2 combinator.

Solutions in BQN:

1‿3‿2 (1+·+´+´⊸>⟜(+`∨)) 4‿3‿1‿5‿2
1‿3‿2 {1++´(+´𝕨)>+`∨𝕩} 4‿3‿1‿5‿2

image

@codereport codereport added the investigate This doesn't seem right label Mar 11, 2024
@codereport codereport self-assigned this Mar 11, 2024
@codereport
Copy link
Owner Author

D2 is spelt: l f : g : r h where d2(f, g, h) = x, y -> g(f(x), h(y)).

The solution to the stated problem is below. Note the combinator tree is all wrong.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant