Interview Question
Country: United States
A boolean array might work just as well, if the numbers are 0 and positive integers. You would have to keep a range of what numbers you have mapped as well. I think it will depend on the nature of the problem because I can see the array being a bad solution if the numbers are real sparse
Use set. It contains unique elements
- DeepDive June 27, 2014