JS: Solution does not match expected output

  • 0

    I'm a little confused by this output:

    For the test case "[1,2,3,8,8]" in problem 491 (Increasing Subsequence), LeetCode marked my solution as "wrong answer" as my output did not match the expected one:

    My output: [[1,2,3,8,8],[2,3,8,8],[3,8,8],[8,8],[3,8],[2,8,8],[2,8],[2,3,8],[2,3],[1,3,8,8],[1,8,8],[1,8],[1,3,8],[1,3],[1,2,8,8],[1,2,8],[1,2],[1,2,3,8],[1,2,3]]

    Expected: [[1,2],[2,3],[1,2,3],[1,3],[3,8],[2,3,8],[1,2,3,8],[1,3,8],[2,8],[1,2,8],[1,8],[8,8],[3,8,8],[2,3,8,8],[1,2,3,8,8],[1,3,8,8],[2,8,8],[1,2,8,8],[1,8,8]]

    Is the ordering of my output expected to match LeetCode's solution? I double checked the two outputs, and they look like they contain the same subsequences.

Log in to reply

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