16
1
Given a non-negative integer or a list of digits, determine in how many ways can the number be formed by concatenating square numbers, which may have leading zeroes.
Examples
input -> output # explanation
164 -> 2 # [16, 4], [1, 64]
101 -> 2 # [1, 01], [1, 0, 1]
100 -> 3 # [100], [1, 00], [1, 0, 0]
1 -> 1 # [1]
0 -> 1 # [0]
164900 -> 9 # [1, 64, 9, 0, 0], [1, 64, 9, 00], [1, 64, 900], [16, 4, 900], [16, 4, 9, 0, 0], [16, 4, 9, 00], [16, 49, 0, 0], [16, 49, 00], [16, 4900]
Rules
- Standard Loopholes Apply
- This is code-golf so the shortest answer in bytes wins
1Sandbox Post – HyperNeutrino – 2017-07-17T23:43:58.720
Can we take input as a list of digits? – totallyhuman – 2017-07-18T00:31:07.080
why is 1 -> 1 but 0 -> 0? – Jonah – 2017-07-18T00:52:53.587
@Jonah Typo... xD – HyperNeutrino – 2017-07-18T01:31:00.580
1@totallyhuman Sure. – HyperNeutrino – 2017-07-18T01:31:28.053