blob: a8172a189a2f19f9fa6b0f94cecbe3234be4faaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#lang racket/base
;; https://www.codewars.com/kata/55e6f5e58f7817808e00002e
(provide seven)
(define (seven m)
(define (impl cur steps)
(define x (quotient cur 10))
(define y (modulo cur 10))
(define next (- x (* 2 y)))
(if (< cur 100)
(cons cur steps)
(impl next (+ 1 steps))))
(impl m 0))
|