In: Computer Science
Code:
(define (atLeast n list) ;;MAIN_FUNCTION
(cond ((= n 0) #t) ;;If n = 0 returns true
((>= (length list) n) #t) ;;if length of list is atleast n then
returns true
(else #f))) ;;else returns false
(define (length list) ;;Helper_Function returns the length of
list
(cond ((null? list) 0) ;;if list is empty returns 0
(else (+ 1 (length (cdr list)))))) ;;else count element and
continue wih rest of the lise
Snapshot of Code and Output: