For example:• (sum empty) ⇒ 0• (sum (list 1 2 3)) ⇒ 6• (sum (list 1 (list 2) 3 (list 4 5))) ⇒ 15
What I have so Far. It calculates the sum of the numbers in the list. The test passes for some of the examples. However, I don't Know how to add if it did consist of numbers, such as example 3.
(define (sum lloi) (cond [(empty? lloi) 0] [else (+ (first lloi) (sum (rest lloi)))]))