Question: Define a function sumSkip (val sumSkip = fn: int list -> int) that takes a list of integers and returns the sum of every other
Define a function sumSkip (val sumSkip = fn: int list -> int) that takes a list of integers and returns the sum of every other element in the list, starting with the first, and skipping alternate elements. For example, sumSkip ( 4 ,3,12 ,6,9,8,11 ,13) returns 4+12+9+11 = 36, sumSkip returns o, sumSkip (13) returns 13, sumSkip 12, 2) returns 12. Hint: Write a helper function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
