Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,13 @@
(use gauche.collection)
(define *permutations*
'("ABCD" "CABD" "ACDB" "DACB" "BCDA" "ACBD" "ADCB" "CDAB"
"DABC" "BCAD" "CADB" "CDBA" "CBAD" "ABDC" "ADBC" "BDCA"
"DCBA" "BACD" "BADC" "BDAC" "CBDA" "DBCA" "DCAB"))
(apply string
(map (^c (car (find-min c :key length)))
(map group-collection
(apply map list (map string->list *permutations*)))))
"DBAC"

View file

@ -0,0 +1,10 @@
(use srfi-197)
(chain
*permutations*
(map string->list _)
(apply map list _)
(map group-collection _)
(map (lambda(xs) (find-min xs :key length)) _)
(map car _)
(apply string _))