vaskoz / dailycodingproblem-go

problems from dailycodingproblem.com solved in Go
MIT License
95 stars 31 forks source link

Day 452 #913

Closed vaskoz closed 4 years ago

vaskoz commented 4 years ago

Good morning! Here's your coding interview problem for today.

This problem was asked by Microsoft.

Let's represent an integer in a linked list format by having each node represent a digit in the number. The nodes make up the number in reversed order.

For example, the following linked list:

1 -> 2 -> 3 -> 4 -> 5 is the number 54321.

Given two linked lists in this format, return their sum in the same linked list format.

For example, given

9 -> 9
5 -> 2

return 124 (99 + 25) as:

4 -> 2 -> 1

vaskoz commented 4 years ago

Identical to Day 127: https://github.com/vaskoz/dailycodingproblem-go/issues/259