• + 1 comment

    There's a nasty problem with many of these challenges; thay all assume something about stdin/stdout and unless we know what that is it's tricky to satisfy the tests.

    I have a solution that runs locally the output of which matches exactly what the test says it should be yet the test fails (there are exceptions and nothing written to stdout).

    Im using F# on Windows - if I run under Visual Studio debug and paste the input to the app's consoles I see it write the correct results to the same console.

    Clearly when run on Hackerrank's system the code is seeing different data to when I run locally; but because I have no idea what the app is seeing I can't reproduce and debug it.

    This has happened on several other challenges, far more effort into getting the IO to work as expected than in the actual problem itself.

    It would be far better if we were simply given two filenames rather than the idiosynchractic stdin/stdout.

    UPDATE:

    I just reran the app and specified < input.txt > output.txt as the command line (so it's truly doing file IO not console) and again I get the correct output here...

    I had similar fiddling around with SuperDigit but that eventually ran and passed all tests, I'm using similar IO code for this challenge but hitting a brick wall - I can't spend hours trying to second guess what's going on!