Created
January 30, 2012 14:06
-
-
Save moritz/1704555 to your computer and use it in GitHub Desktop.
RT #77474
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
multi sub infix:<merge> (@ [], @y) is default { @y }; | |
multi sub infix:<merge> (@x, @ []) { @x }; | |
multi sub infix:<merge> (@x [$x, *@xtail], @y [$y,*@ytail]) { | |
if $x < $y { $x, (@xtail merge @y) } | |
elsif $x > $y { $y, (@x merge @ytail) } | |
else { $x, (@xtail merge @ytail) } | |
} | |
my @hamming := (1, (@hamming X* 2) merge (@hamming X* 3) merge (@hamming X* 5)); | |
say ~@hamming[^20]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment