+ 1

Convert US date to European date - test 3 fails

I see a lot of postings for this question, I like your regex approach, everyone! Please help me fix my solution, I don't know why the third hidden case fails: https://code.sololearn.com/cn0Mv5cKlZGF/?ref=app

7th Mar 2022, 8:08 AM
boneSpider
boneSpider - avatar
2 Réponses
+ 2
It gives some weird outputs if day or month is a single digit. For example, 7/26/2019 returns 6//7//019
7th Mar 2022, 8:34 AM
Simba
Simba - avatar
+ 1
Simba, thank you for pointing that out. I didn't think about single digit months and/or days
7th Mar 2022, 8:55 AM
boneSpider
boneSpider - avatar