Skip to content

Missing information in shared numbers problem #12

@vivek12345

Description

@vivek12345

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions