3 ms·
A harder task might be "Randomly delete, add or mutate a single character". We had a few similar tasks on CGSE, e.g. • http://codegolf.stackexchange.com/q/448
by ygra 13y ago
A harder task might be "Randomly delete, add or mutate a single character".
We had a few similar tasks on CGSE, e.g.
• http://codegolf.stackexchange.com/q/4486/15 http://codegolf.stackexchange.com/q/4486/15
• http://codegolf.stackexchange.com/q/18087/15 http://codegolf.stackexchange.com/q/18087/15
- dllthomas 13y agoAddition and deletion anywhere but the end seems overwhelmingly unlikely.
- ygra 13y agoDepends on how the code is stored in memory ... with ropes addition or deletion anywhere could happen.
- dllthomas 13y agoTrue! But: 1) it's still less likely - most of the data is almost certainly characters of content, not sizes; 2) it's unlikely to be robust against flipped bits in pointers in the rope structures (even if implemented as indexes); and 3) there is no reason to expect it to be limited to one byte (if an addition or deletion happens, "more than one byte" is far more likely than "one byte").