LeetCode Day 1: Add Two Numbers with Linked List Traversal in C

Day 1 of #30DaysOfLeetCode Solved #2. Add Two Numbers on LeetCode using C. Approach: • Used Linked List traversal to process both numbers digit by digit • Added digits from both lists along with a carry value • Created new nodes dynamically to store each result digit • Handled cases where lists have different lengths • Continued the loop until both lists and carry were processed Performance: • Runtime: 0 ms (Beats 100% submissions) • Memory: 13.50 MB (Beats 8.30% submissions) Key Learning: • Strengthened understanding of Linked Lists and pointer manipulation • Learned how to manage carry during digit addition • Improved problem-solving skills with dynamic node creation Learning one problem every day 💻🔥 #30DaysOfCode #LeetCode #CProgramming #DSA #LinkedList #ProblemSolving

  • graphical user interface, text, application, chat or text message

To view or add a comment, sign in

Explore content categories