Thursday, August 17, 2017

[Leetcode]Add Two Numbers

LC Link 1. line 11, use while loop controls on 11, l2 and carry
2. line 13,16, take care of l1 and l2 separately.  Cuz you always want to check Nullness before you access its attributes.
3. line 21, use carry, curr_val = divmod(raw_num, 10) to speed up process
4. line 9,22, be clear on the requirement. output as problems wanted

No comments:

Post a Comment