The only case the details says will not be tested is an empty string.
The input should consist of only binary didgets and those didgets should only represent numbers which are multiples of three.
anything else your regex should fail to match.
its a shame c++ regex doesnt have lookbehinds
Approved some time ago
must be an image blocker then
I still see it
The image does not load. Is this a kata issue?
I think that ("E", 4) should returns 264 rather than 256, below is how I calculate manually:
Let's say there are two types of nodes : inner (B, D, F, H) and outer (A, C, G, I)
Since we have 4 steps, our permutation of nodes must be :
E -> inner (4) -> inner (3) -> __ (6)
E -> inner (4) -> outer (4) -> __ (5)
E -> outer (4) -> inner (4) -> __ (6)
E -> outer (4) -> outer (1) -> __ (4)
where __ means the remained nodes and the number in bracket means the possible number of node
By rule of product and rules of sum, the total number of ways is 264.
Is there something wrong about the count method above or something?
Very good kata ! Quite impressed by people who solved it by hard coding values xD
A lot of solutions with hard coded values. lol.
This comment is hidden because it contains spoiler information about the solution
I agree - this was a good one, and fun, but not nearly as difficult as the ranking would suggest.
Wait, it is claimed that The input should consist only of binary digits - no spaces, other digits, alphanumeric characters, etc.
But in the next string the last example for JS ismultipleof3Regex.test(' abc ') should be false.
The input should consist only of binary digits - no spaces, other digits, alphanumeric characters, etc.
multipleof3Regex.test(' abc ') should be false
But ' abc ' can NOT be input, because it contradicts the condition, can it?
It works fine for me.