Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (helper l current count)
- (cond
- [(and (null? l) (= count 0)) '()]
- [(and (null? l) (not (= count 0))) (list count current)]
- [(= (car l) current) (helper (cdr l) current (+ 1 count))]
- [else (append (list count current) (helper l (car l) 0))]))
- (define (next-look-and-say l)
- (helper l (car l) 0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement