Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 311 Bytes

4.md

File metadata and controls

3 lines (2 loc) · 311 Bytes

You have an array with all the numbers from 1 to N, where N is at most 32,000. The array may have duplicate entries and you do not know what N is. With only 4 kilo- bytes of memory available, how would you print all duplicate elements in the array?

4k bytes = 4 * 1024 * 8 bits > 32000. So we can use bit map.