math
-
[linked list] add two numbersAlgorithm/LeetCode 2025. 4. 20. 11:40
✅ Problemhttps://leetcode.com/problems/add-two-numbers/description/ ✅ Approach & Solution방식) 반복문 사용더보기반복문을 사용해 첫 번째 연결 리스트, 두 번째 연결 리스트, 자리올림수를 모두 처리할 때까지 반복dummyNode 생성하여 연결 리스트 구현 (null 확인 로직 줄이기 위함)/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this.val = val; } * ListNode(int val, ListNo..