diff --git a/src/DataTypes.java b/src/DataTypes.java index 4f807c1f..31cbc320 100644 --- a/src/DataTypes.java +++ b/src/DataTypes.java @@ -1,13 +1,12 @@ import java.util.List; public class DataTypes { - // TODO TASK 1: fix this code so that it passes the test in DataTypesTest.java public static long sum(List numbers) { int s = 0; // below is a "foreach" loop which iterates through numbers for (int x : numbers) { - s += x; + s += numbers.get(x); } return s; }