Skip to content

optimize(2109): adding spaces to a string #2

@massivebird

Description

@massivebird

Challenge

I peeked at the better solutions. They turn the input string into bytes, iterate through the strictly-increasing collection of space indices, and do byte(?)-wise copying accordingly.

My question: is this low-level copying that much better than my high-level iterative approach? Or is there some finer optimization happening? (I think it really is simply better)

Metadata

Metadata

Assignees

No one assigned

    Labels

    optimizationOptimize a passing solution

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions