2698. Find the Punishment Number of an Integer
Given a positive integer
n, return the punishment number ofn.The punishment number of
nis defined as the sum of the squares of all integersisuch that:
1 <= i <= n- The decimal representation of
i * ican be partitioned into contiguous substrings such that the sum of the integer values of these substrings equalsi.