X44: sum67

Given an int array, return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7 (every 6 will be followed by at least one 7). Return 0 for no numbers.

Examples:

sum67({1, 2, 2}) -> 5
sum67({1, 6, 2, 2, 7}) -> 1

Your Answer:

Feedback

Your feedback will appear here when you check your answer.