Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let sum: ([Int]) -> Int
- sum = { values in
- if values.isEmpty {
- return 0
- }
- else {
- return values.first! + sum(Array(values.dropFirst()))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement