← ALL NOTES
Math

2698. Find the Punishment Number of an Integer

The punishment number of an integer n is the sum of i·i over all i from 1 to n such that the decimal representation of i² can be split into contiguous parts summing to i. Return it. For each i, check…

Loading…