bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyMath & GeometryLC 66

Plus One

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's. Increment the large integer by one and return the resulting array of digits.

Asked at 11 companies
AdobeAmazonApple
Hints
  • 1.Think about what data structure fits Plus One
  • 2.Consider the brute force complexity and how to optimize
  • 3.Can you trade space for time?
LeetCodeNeetCode