sum13
Objective: Write program code to create, traverse, and manipulate elements in 1D array or ArrayList objects.
Complete the method sum13, which returns the sum of the numbers in the list, returning 0 for an empty array. Except the number 13 is very unlucky, so it does not count, and numbers that come immediately after a 13 also do not count.
sum13([1, 2, 2, 1])->6
sum13([1, 1])->2
sum13([1, 2, 2, 1, 13])->6
The following are methods of a list that can be used to manipulate the contained data.
Type your solution
Skills Practiced:
3.C
3.D
4.A
4.B
Saved
Saved