Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##
- ;"4"
- ##
- ~:N
- # Build up
- 1,](({
- # Array of boxed-123-avoiding arrays of length i.
- # Consider possible insertions of i into each array.
- # Since i will be the largest, we can neglect substitution by removing the largest.
- :A
- {
- .,:I,1/{
- # arr [val]
- .2$@/\I+*
- }%
- I@+\~
- }%
- # Filter
- {
- # array
- [
- .({1$<-}+%
- 1$){1$<-}+%
- @0-{(}%
- ]
- # [array-least array-leftmost array-rightmost] all renumbered
- A-!
- },
- [3,]-
- }*
- `#,
Advertisement
Add Comment
Please, Sign In to add comment