Redwan vai, please help me out. I’ve uploaded two C++ source files as the solutions for this problem in Toph Drafts. I also created the test files using these (externally). These two codes are working fine on my device. I also checked them on IDEone. They are working well there too. But when I try executing them from Toph Drafts, the output shows empty which results in a Wrong Answer. For the sample test case, it’s giving the correct output. But why is this happening in the rest of the test files? @hjr265
I am assuming you were able to solve the issue…?
Yeah. Solved the issue.
After I posted here, I thought about why it was giving outputs for the sample test case and why it was not giving any outputs for the others. Then it came to my mind that, it can be an issue with line endings. So I checked manually and guess what, CRLF line endings!
dos2unix did the rest of the work.
But I think there is a feature in Drafts to detect and solve this type of line ending issue (I used it many times). Then why didn’t I see any error messages? (Maybe the test files are too big? )
That is odd.
Drafts’ code editor component now automatically takes care of line endings (anything you enter through the code editor gets transformed to LF line endings automatically).
And, anything you upload should trigger the line ending check and show warnings where relevant.
I will investigate why exactly you didn’t see any error message. File size should not be an issue.