Yes, you are right. But, even if we've stored unique values inside populateArray such as alphabet(a-z) it would still have taken more time than Set. Because it still has to iterate it over with O(n) complexity. What I was trying to show is a mere demonstration of execution of speed
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, you are right. But, even if we've stored unique values inside populateArray such as alphabet(a-z) it would still have taken more time than
Set
. Because it still has to iterate it over with O(n) complexity. What I was trying to show is a mere demonstration of execution of speed