Something wrong with the submission.

  • 0

    I have completed my code and it's working for valid inputs. But, I am facing a hard time submitting it. On submitting the code, it says that my code gives out a wrong answer for the input. [0, 4, 3, 0] 0

    The test case running here seems to be invalid. There are two answers for this. [1, 1] and [1, 4]. The test case gives the former one while mine gives the latter.

    I fail to understand why such input is being used here when the question mentions "You may assume that each input would have exactly one solution."

    Any ideas on where should I report this ?

    Thanks in advance.

  • 2

    [1, 1] is not a valid answer, because:

    "index1 must be less than index2"

  • 0

    Yes, [1, 1] is an invalid answer. But, again this is the answer coming from the test framework.

    Also, don't you think the input test case itself is wrong ? How should I proceed and submit my code ?
    (Btw, I just double checked and the submission still fails due to the above)

  • 0

    Ok. got it. Please ignore my earlier comment.

  • 0

    "this is the answer coming from the test framework."

    You mean the "expected answer"? What programming language?

    "don't you think the input test case itself is wrong ?"

    No. And I thought the test case itself was what we were talking about?

  • 0

    I am sorry for my first comment. I hastily commented without looking much into details.

    I just got it right and was able to successfully submit my code.

    Thanks once again for pointing out my mistake.

  • 0

    hey, the test case works fine for me on custom test case but when i run it for submit solution, it gives me runtime error. what am i missing?

Log in to reply

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