This is n log(n) time complexity. can't we simply do O(n) without sorting?
n log(n)
O(n)
every time i look answers like this i learn something
This comment is hidden because it contains spoiler information about the solution
yep, 2 years later, I wouldn't say that anymore... x)
no, in this case it is NOT
Loading collection data...
This is
n log(n)
time complexity. can't we simply doO(n)
without sorting?every time i look answers like this i learn something
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
yep, 2 years later, I wouldn't say that anymore... x)
no, in this case it is NOT
This comment is hidden because it contains spoiler information about the solution