Skip to content
RED SAGSkills
medium10 pts · first answer countsarraysin-place

All duplicates with O(1) extra space

Values in [4, 3, 2, 7, 8, 2, 3, 1] are between 1 and n, and some appear twice. Marking a[|v| - 1] negative as you go, which values are reported as duplicates?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions