로딩
요청 처리 중입니다...

JAVA_Add to Array-Form of Integer_LeetCode 989

 JAVA_Add to Array-Form of Integer_LeetCode 989

JAVA_Add to Array-Form of Integer_LeetCode 989 풀이 class Solution { public List addToArrayForm(int[] num, int k) { LinkedList res = new LinkedList(); int n = num.length - 1; // LinkedList의 addFirst를 이용하여 계산한 값을 앞에 추가(추가할때마다 밀려남) while(n >= 0 || k != 0){ if(n >= 0) k += num[n--]; res.addFirst(k % 10); k /= 10; } return res; } } * 출처 https://leetcode.com/problems/add-to-array-form-of-integer/ Add to Array-Form of Integer - LeetCode Can you solve this real interview question?

Add...

# AddtoArray_FormofInteger_LeetCode989 # JAVA # JAVA_AddtoArray_FormofInteger # JAVA_AddtoArray_FormofInteger_LeetCode989 # JAVA_LeetCode989