Default algo in "expected result" gives a wrong answer to this custom test case


  • 0
    E

    Default algo that gives expected result gives a wrong answer to this custom test case

    213
    [12,28,83,4,25,26,25,2,25,25,25,12]

    Website says expected is 8, however it is clear that expected is 7

    83, 28, 26, 25, 25, 25, 25 Sum = 237


  • 2
    E

    Actually, I was wrong.
    I was trying to solve a different kind of problem.

    Basically, everything is the same, but try to find min number of values in the array (regardless of their sequence) which sum would be greater than s.

    If you try to solve that kind of problem, then out of 14 tests 12 would pass, but you'll get a wrong answer for 13th one.

    Expected is 132, you'd get 80.

    Test starts like that
    697439
    [5334,6299,4199,9663,8


Log in to reply
 

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