"You may assume there are no leading 0", but there is a list with a leading 0!


  • 0
    F

    Test case 1277 / 1562 of this challenge has a list with a leading 0 while the instruction say that there would be no test case with a leading 0. Am I misunderstanding the instructions or did I actually spot an issue?

    Input:
    [0,8,6,5,6,8,3,5,7]
    [6,7,8,0,8,5,8,9,7]
    Output:
    [4,4,4,7,6,9,3,7,8]
    Expected:
    [6,5,5,6,4,4,2,5,5,1]
    Stdout:
    75386568 // I am printing the reverse number I obtained from the list and of course the 0 is lost.
    798580876
    

  • 1

    Looks like you already forgot that the list stores the digits in reverse order. That zero isn't leading, it's the number's last digit (in its decimal representation).


  • 0
    F

    thanks for the clarification. I thought leading in the list not in the number.


Log in to reply
 

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