frontend-interviewing icon indicating copy to clipboard operation
frontend-interviewing copied to clipboard

Missing information in shared numbers problem

Open vivek12345 opened this issue 3 years ago • 0 comments

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;
}

vivek12345 avatar Jun 25 '21 01:06 vivek12345