306.Additive Number
Aug 30, 2016
https://leetcode.com/problems/additive-number/
If we have first number and second one, the rest of numbers are determined.
So we just select first and second number as many as possible and examine if the rest of the number is
the ones we want. Noted that the total length of the first and second number should be no more than the
rest of the numbers because addition only increase the length of the number. To prevent overflow from
large integer, we can use BigInteger
since it supports arbitrary-precision integers.
|
|