4 ms·
It would build an array of n distinct elements. And for efficiency, this comment [0] is about the drawbacks of the solutions used in the article. [0] https://n
by woliveirajr 9y ago
It would build an array of n distinct elements. And for efficiency, this comment [0] is about the drawbacks of the solutions used in the article.
[0] https://news.ycombinator.com/item?id=14407404 https://news.ycombinator.com/item?id=14407404
- contravariant 9y agoFor the line "70 print "Value " x " has " a(x) " repetitions"" to work you'd need an array with 2^64 elements. That said the code as you wrote it would just result in an array filled with 10 million entries, all of which are 1 (assuming the array is initialized to 0).
- woliveirajr 9y agoYou're right, I was just thinking in the counting of repeated values. Can't edit to correct now...