Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -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)))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue