• @cadekat
    link
    8
    edit-2
    2 months ago

    This looks like O(n), because you don’t include constants when calculating Big-O. It’s still ~26 times slower than the implementation without the inner loop.

    This looks like O(n^2) because of the sub.

    I was right the first time. sub is “substring” and not “substitute”.