Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
#lang racket
(define (get-digits number (lst null))
(if (zero? number)
lst
(get-digits (quotient number 10) (cons (remainder number 10) lst))))
(define (self-describing? number)
(if (= number 0) #f
(let ((digits (get-digits number)))
(for/fold ((bool #t))
((i (in-range (length digits))))
(and bool
(= (count (lambda (x) (= x i)) digits)
(list-ref digits i)))))))