Ad
  • Custom User Avatar

    No, that's wrong.

    • first, the string is too short to conclude anything with that test (you're measuring the number of function calls rather than the actual "string work")
    • second, the actual speed will depend on the python version used. I don't know which one you used, but for instance trying with 3.7 (yeah, I know, but that's the only one I have access to on my current machine), replace is close to 3x faster on huge strings (like, x1000). And on small strings, it's also faster anyway, but the time consumption is so ridiculously low it's not even worth comparing: 5ms against 3ms...
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution