
[LeetCode] 2698. Find the Punishment Number of an Integer (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명 Given a positive integer n, return the punishment number of n. The punishment number of n is defined as the sum of the squares of all integers i such that:1 The decimal representation of i * i can be partitioned into contiguous substrings such that the sum of the integer values of these substrings equals i. 문제 예제Example 1:Input: n = 10Output: 182Explanation: There are exactly 3 ..