Created
October 9, 2010 06:38
-
-
Save wasabili/617957 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 file.util) | |
(use util.combinations) | |
(use srfi-1) | |
(define (flatten-number xs) | |
(string->number (apply string-append (map number->string xs)))) | |
(let* ((input (map string->number (file->string-list "input.txt"))) | |
(k (second input)) | |
(nums (drop input 2))) | |
(print (length+ (delete-duplicates (map flatten-number (append-map permutations (combinations nums k))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment