Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- ;(apply append (map (lambda (x) (clone x n)) lst))
- (define (get-depth lst n)
- (cond
- ((null? lst) '())
- ((list? (car lst)) (cons (get-depth (car lst) (+ n 1)) (get-depth (cdr lst) n)))
- (else (cons n (get-depth (cdr lst) n)))
- )
- )
- (flatten (get-depth '((((a))) ((b)) (c)) 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement