My program is showing all the outputs correct but yet Solo Learn is showing it as Incorrect. Can anyone explain? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

My program is showing all the outputs correct but yet Solo Learn is showing it as Incorrect. Can anyone explain?

I made a raw program of "Military Time" and i know it's too bad to show but surprisingly it's producing correct output. But Solo Learn app is showing it incorrect. https://code.sololearn.com/cC6LdvyBxFWc/?ref=app

8th Oct 2020, 9:56 PM
Vijay
Vijay - avatar
4 Answers
+ 2
Regarding the seemingly correct output: Whenever your solutions appear correct but are not approved, it is usually because you print characters without a console representation somewhere. For example, in your program both paths lead to the string containing a null character, which is not visible on the console, but nonetheless in the output buffer. As a consequence, the string comparison between the given solution and your own will fail due to that extra character in the buffer.
9th Oct 2020, 10:38 AM
Shadow
Shadow - avatar
+ 4
I made a code for you: https://code.sololearn.com/cvuClLi8Z3ph/?ref=app hope it helps :)
8th Oct 2020, 10:48 PM
Galaxy-Coding (inactive)
Galaxy-Coding (inactive) - avatar
+ 1
Thanks for the help buddy Galaxy-Coding. But could you just explain what is actually happening with the program I made I mean it's showing the correct output, right? What's the problem, then?
9th Oct 2020, 5:44 AM
Vijay
Vijay - avatar
+ 1
Thanks for the information Shadow. 🤝 By the way, few hours back, I figured out the solution. I just displayed the string using using a loop and it worked.
9th Oct 2020, 1:25 PM
Vijay
Vijay - avatar