383
Who cares about time complexity
(lemmy.world)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
I don't know what happens when the substring overlaps. Like for the number 6, will it replace the first 5 I's with V and end up correctly with VI or the last ones and come to IV? I would guess the former and maybe you know but I never thought about it before
I’ve written it that way and it works, as in it will replace left to right and you replace iiii to iv after iiiii to v
Also does not handle 'IIIIIIIII' -> 'IX' properly
If the substitution went right to left it might work.