-
-
Save 2colours/d4d247d98fa2d6071069387aaad4844a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6.*; | |
my $str = "abcd"; | |
my @split-positions <== 0 ^..^ $str.chars andthen .combinations; | |
my @splitters <== @split-positions>>.map: { *.key < $_ }; | |
@splitters.map({ $str.comb.pairs.snip($_)>>.value>>.join }).say; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment