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

JAVA_LeetCode 2269_Find the K-Beauty of a Number

 JAVA_LeetCode 2269_Find the K-Beauty of a Number

JAVA_LeetCode 2269_Find the K-Beauty of a Number 풀이 class Solution { public int divisorSubstrings(int num, int k) { // 약수를 찾을때 0이 아니고, 숫자를 해당 약수로 나눴을 때 0이 되면 반환값을 더해준다. int cnt = 0; String str = String.valueOf(num); for(int i = 0; i <= str.length() - k; i++){ if(Integer.parseInt(str.substring(i, k + i)) != 0 && (num % Integer.parseInt(str.substring(i, k + i)) == 0)) cnt++; } return cnt; } } * 출처 https://leetcode.com/problems/find-the-k-beauty-of-a-number...

# JAVA # JAVA_FindtheK_BeautyofaNumber # JAVA_LeetCode2269 # JAVA_LeetCode2269_FindtheK_BeautyofaNumber # LeetCode2269_FindtheK_BeautyofaNumber