Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Comment
by
dgrunwald
· 10mo ago · 0 comments
That loop isn't N²: if there are long sequences of dashes, every iteration will cut the lengths of those sequences in half. So the loop has at most lg(N) iterations, for a O(N*lg(N)) total runtime.
Comments
No comments yet.
Better HN