diff --git a/answers/advanced/sharedNumbers-a.js b/answers/advanced/sharedNumbers-a.js index fe60ed7..0d8b890 100644 --- a/answers/advanced/sharedNumbers-a.js +++ b/answers/advanced/sharedNumbers-a.js @@ -7,6 +7,7 @@ function shared(x, y) { if (curr1.value === curr2.value) { commonNumbers.push(curr1.value); curr1 = x.next(); + curr2 = y.next(); continue; } diff --git a/questions/advanced/sharedNumbers.js b/questions/advanced/sharedNumbers.js index ab701b9..cdd3ffc 100644 --- a/questions/advanced/sharedNumbers.js +++ b/questions/advanced/sharedNumbers.js @@ -1,5 +1,6 @@ // Create a "shared" function that takes two array iterators // and returns the numbers common in both arrays. +// Assume the array is sorted in non decreasing order and has no duplicates /* const i1 = function* () {