Skip to content

Instantly share code, notes, and snippets.

@egisatoshi
Created September 19, 2018 22:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egisatoshi/4920654983d3c00c6939ddab9ed0f76e to your computer and use it in GitHub Desktop.
Save egisatoshi/4920654983d3c00c6939ddab9ed0f76e to your computer and use it in GitHub Desktop.
% 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