Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @David_Augusto_Villa,validated by @Eulero314,@TBali and @BerserkVl.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @David_Augusto_Villa,validated by @Eulero314,@TBali and @BerserkVl.
If you have any issues, feel free to ping them.
TLDR: in C++ unicodes are a joy to work with.
In your test cases you use the unicode \u2019 (’ == RIGHT SINGLE QUOTATION MARK) as an apostrophe instead of '. I treated it as a 2bytes character (like every other unicode char you provide) but it turns out it is a 3 bytes wide character. For all test cases and validators except validator 2, this misinterpretation poses no problem. On validator 2 however it is, as…
…skipping 1 char when we encounter ’ in “l’âme” made me skip the ‘â’ altogether, and therefore I kept both French AND Italian as valid languages for line 1 and 9 and couldn’t pass validator 2 in the first place. I passed it by considering " è " as italian-only before figuring out that ’ was actually 3 char wide and coming here to rant.
Still enjoyed the solve, cheers.
Thank you for reporting that. Yes, I’m aware there are difficulties, and it was not my intention to spring upon you unexpected surprises like that. I will modify all punctuation to 1 or 2 bytes. It would also be nice to link to some sort of guide on CodinGame which discusses the issues with Unicode, in particular to at least state which languages do not have support.
This puzzle is supposed to have the tags: Natural language, Unicode, Constraint satisfaction
This is a relatively new area for CodinGame. It was worse previously: the console had never displayed non-ASCII characters correctly (so I would have outright rejected your contribution for that reason alone if you had published it back then). I raised the issue a few months ago, and it took two or three rounds of fixes from the CodinGame staff before such characters were displayed properly.
If anybody has insights into how well different programming languages on CodinGame handle Unicode, I encourage you to start a new forum thread or a tech.io playground on the topic. Your contribution would be greatly appreciated!
I found the most difficulty in C/C++, Lua, Objective-C, Pascal, Perl, and PHP.