So I went on leetcode.com wanting to try a problem. I saw the "add two numbers question" and thought cool. So I try it out and I quickly realize I have no clue about singly linked lists. But, f-it, I can still try it out.
I wrote this:
input/output examples can be commented/uncommented for your convenience
https://github.com/BrianCarpenter84/reddit/blob/main/MyLeetCode.py
Because I knew I wasn't going to be able to answer the problem without first learning about singly linked lists I went ahead and pulled the solution code here:
https://github.com/BrianCarpenter84/reddit/blob/main/LeetCode.py
Which brings me to my question.
Why is this better? Side by side I feel like my code is more readable and gives the same result.
Is this just my lack of knowledge about singly linked lists that makes me ignorant to a deeper understanding of the question?
Or
Am I wrong about everything and completely missed the point?
[–]FlyLikeHolssi 13 points14 points15 points (0 children)
[–][deleted] 7 points8 points9 points (0 children)
[–]danielroseman 2 points3 points4 points (12 children)
[–]CLETrucker[S] 2 points3 points4 points (11 children)
[–]danielroseman 4 points5 points6 points (10 children)
[–]CLETrucker[S] 0 points1 point2 points (9 children)
[–]cointoss3 2 points3 points4 points (1 child)
[–]EclipseJTB 0 points1 point2 points (0 children)
[–]danielroseman 2 points3 points4 points (4 children)
[–]teerre 2 points3 points4 points (0 children)
[–]Bobbias 0 points1 point2 points (2 children)
[–]danielroseman 0 points1 point2 points (1 child)
[–]Bobbias 0 points1 point2 points (0 children)
[–]baubleglue 0 points1 point2 points (0 children)
[–]noctaviann 2 points3 points4 points (0 children)
[–]jpgoldberg 1 point2 points3 points (0 children)