frontend-interviewing
frontend-interviewing copied to clipboard
Missing information in shared numbers problem
Should we may be add another comment on the problem statement stating A) Array is sorted in non-decreasing order B) Duplicates are not allowed
Also should this line https://github.com/young/frontend-interviewing/blob/master/answers/advanced/sharedNumbers-a.js#L9
if (curr1.value === curr2.value) {
commonNumbers.push(curr1.value);
curr1 = x.next();
continue;
}
Instead be
if (curr1.value === curr2.value) {
commonNumbers.push(curr1.value);
curr1 = x.next();
curr2 = y.next();
continue;
}