LeetCode Getting Tricky

I decided I would try to LeetCode exercises for practice. Nailed the first one I tried yesterday. It was an easy problem. The one I tried today was assessed as Medium difficulty. At first I thought the problem was easy. It passed the sample test case pretty quickly. Then I saw what the challenge was. They were testing you for huge numbers.

At first I tried to just change my variables from int to long. Nope. Not good enough. Then I tried long long int. Figured they might be testing up to that. Nope. They were dealing with huge numbers. I did not want to implement a big number library. Should not have been a need to copy and paste the code for such a library too.

Then it dawned on me. They were providing the input numbers in a weird linked list format that encouraged the use of big number addition. I did not need to implement the whole big number library. Just needed to be able to add two digits, and determine if there was any carry over to the next place.

These LeetCode problems are tricky. And I have not gotten to a Hard problem yet.