0
Does anyone know what’s wrong with this challange?
I was solving the us To eu date Converter challange and in the results section it says that is wrong when the output is correct Input: January 1, 2019 Output expected: 1/1/2019 Output: 1/1/2019 https://code.sololearn.com/c31Grq34g3h0/?ref=app
7 odpowiedzi
0
David Valladares Lopez
Did you checked the output?
It's giving wrong output...
In first case you are swapping with 0 to 3, 1 to 4.
But here in this case 1/1/1991
3rd is /
0th is 1
And 1 is /
4th is 1
You getting output : /111/991 a wrong one. It should be same as input in that case.
0
Actually that function that you are talking is only for the first situation, when the input is in this format: MM/DD/YYYY.
in the case of the problem that function doesn’t affect. And, yes, i checked the output, its 1/1/2019
0
Yes. But you need check all the conditions..
OK. Where you getting problem then?
0
in the second condition when the date format is: Month Day, Year. If the input is: January 1, 2021 the the output of my code is 1/1/2021 and the expected is 1/1/2021. And idk why im getting this problem wrong
0
See carefully about the spaces..
After camma there is space before 2021. You should remove it....
0
Yeah man, i actually removed it, there is no spaces in the output, i checked twice with sololearn’s compilator and the ide that i use. And the output has no spaces
0
Your program is not giving the expected output for the case like 11/1/2020..
Edit:
OK. Finally you got it.. Fine.