Add Two Numbers(linked list)
You are given twonon-emptylinked lists representing two non-negative integers. The digits are stored inreverse orderand each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
Example:
分析
while l1 or l2 or carry:包含所有情况,记得cur l1 l2都要往下走
PreviousRegular Expression Matching(DP)NextRange Minimum Query (Square Root Decomposition and Sparse Table)
Last updated
Was this helpful?