4 ms·
One downside of both solutions is that they both traverse the list twice, which could be expensive when we're talking about real data and not toy problems.
by shmageggy 8y ago
One downside of both solutions is that they both traverse the list twice, which could be expensive when we're talking about real data and not toy problems.