Test case fails in OJ, passed in my linux environment.


  • 0
    C

    Is anyone else getting this issue?

    I pasted my code in my linux environment, wrote a wrapper main() to call my solution, and this case produces the desired result on my system.

    But in the OJ it fails.

    Input: ["..9748...","7........",".2.1.9...","..7...24.",".64.1.59.",".98...3..","...8.3.2.","........6","...2759.."]
    Output: ["..9748...","7........",".2.1.9...","..7...24.",".64.1.59.",".98...3..","...8.3.2.","........6","...2759.."]
    Expected: ["519748632","783652419","426139875","357986241","264317598","198524367","975863124","832491756","641275983"]


  • 0
    C

    Oh, and it takes 12 ms, so I doubt it is TLE. Besides OJ says wrong result.


  • 1
    Q

    I saw the OJ returns a wrong result for another problem today. On my machine, my code returns the right answer, but OJ says it returns a different wrong answer. Not sure what is happening.


  • 0
    C

    Never mind. While debugging I had created a separate copy of the input, and I was solving the problem in this copy. So the copy had the final result, and not the real input board. (Facepalm).


  • 0
    I

    When that's happened to me it was either due to an uninitialized variable, or code reading beyond the end of an array. Differences in the compilation environment will cause the code to pass in one place and fail in the other.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.