What is it with single 0 in input list?


  • 0
    A

    Unable to understand how the problem test cases are formed.

    When I input as custom case say, [0, 1, 2, 3, 4]

    The expected output is shown to be:
    [24, 0, 0, 0, 0]

    same goes if I shift the 0 in any other place on the list and the value 24 would be shifted to that place in corresponding expected output.

    But, if I put another 0 in the list, say [0,1,2,0,3,4]
    then the expected output shows an all 0 list:

    [0,0,0,0,0,0]

    Could someone please explain the reasoning behind?


Log in to reply
 

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