LLD - Behavioral Design Patterns — Part 1
Given the following pseudo-code for an iterator over a list of integers:
iterator = list.getIterator()
sum = 0
while (iterator.hasNext()) {
sum += iterator.next()
}
print(sum)
What will be the output if the list contains [1, 2, 3, 4]?
