Created
September 19, 2018 22:37
-
-
Save egisatoshi/4920654983d3c00c6939ddab9ed0f76e 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
% cat anagram.egi | |
(define $anagram? | |
(lambda [$xs $ys] | |
(match ys (multiset eq) | |
{[,xs #t] | |
[_ #f]}))) | |
(anagram? (between 1 31) (reverse (between 1 31))) | |
(anagram? (between 1 31) (reverse (between 2 32))) | |
% time egison -t anagram.egi | |
#t | |
#f | |
egison -t anagram.egi 0.27s user 0.01s system 93% cpu 0.299 total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment