Requirement is not clear, why answer to [9] is [1,0] instead of [11]?

  • 0

    May be I am not getting requirement clearly but can you please explain why should I expect output [1,0] instead on [10] when I give input as [9] and [1,11] when I give input as [10]? Shouldn't it be just one increase of input number?

  • 0


    The intent of the problem is that each element of the array represent one digit in the number, with a range of 0-9. That implies that carries have to be propagated to the next higher digit (and so previous array element) rather than contained in the same element.

Log in to reply

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