Given n, find the sum of squares of the 'special' numbers in 1..n, where a number is special if the digits of its square can be partitioned into contiguous parts summing to the number (e.g. 9->81 (8+1), 10->100 (10+0), 36->1296 (1+29+6)). n=10 -> 181; n=37 -> 1477; 1<=n<=10^5.
Asked in the online assessment stage.
Implement special_square_sum(n), which returns an integer. A partition must contain at least two nonempty contiguous parts, and a part may contain leading zeroes. For example, 100 can be split as 100 + 00. Return 0 when no special number exists.
def special_square_sum(n):