3 ms·
Well thanks for assuming ignorance rather than amusement on my part. I've always found the entire concept of reversing a string amusing enough, now I get to ad
by jameshart 11y ago
Well thanks for assuming ignorance rather than amusement on my part.
I've always found the entire concept of reversing a string amusing enough, now I get to add another example of why the entire problem is ill-defined. What is the reverse of the 'white woman hearts black man' emoji? Is it a 'black man hearts white woman' emoji?
The realistic string handling problem this will at least bring to light is probably more likely to be an issue with strong truncation than with ill-formed interview questions. As you say, if this brings the risk of splitting combining characters to the fore maybe more software will handle it in the future.
- peteretep 11y ago> What is the reverse of the 'white woman hearts black > man' emoji? Is it a 'black man hearts white woman' emoji No, because when denormalized it consists of codepoints joined by U+200D ZERO WIDTH JOINER, which suggests it's a single grapheme, which means you shouldn't break it apart when reversing.