Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Fixed.
I think this comment just cleared up why I was failing the some of the tests! I have to finish this before the Trazadone kicks in or I'll start slurring my coding
You construct the rest of the key from either the initial input string (encode) or the decoded output string (decode).
It is still very unclear. Your use of the word "and" leaves multiple syntactically and semantically valid interpretations. Your test cases seem to support BOTH interpretations.
So it could be Every (encoding and decoding) is independent, which passwordpasswordpassword -> aaaaaaaapasswordaaaaaaaa supports. If you didn't 'remember' the key from the encode, passwordpasswordpassword should be aaaaaaaaaaaaaaaaaaaaaaaa
OR it could be Every encoding and (every) decoding is independent, which the "it's a shift cipher!" test case supports
Does that mean that a pair of calls (encode, decode) use the same CONSTRUCTED key and then it's reset when the second function is called?
What about encode encode?
The encode/decode functions aren't hard to write here, but the actual expectation of the problem is poorly defined.
Added the following:
Every encoding and decoding is independent (still using the same key to begin with)
Let me know if you think this is an improvement, meanwhile I'm marking this as resolved.
I'll try to explain:-) We take by packet of at most 3; if we can take a packet of 3 "isolated" or not, we take it, if there is a packet of 1 or 2 we take them if they are, in some sense, "isolated".
the first "0" is isolated, take it. In "9026315" we take the first packet of 3 (902) then "631" then "5" so we don't get a second "0" and we don't get 1.
we take a first packet "100" (not "cubic") and then "0" which is cubic and the only one in the string
we get effectively 407 and it is the only one. The other packets of 3 are not "cubic".
I hope that it's a bit more clear? There is no real question of "separated" or not.The only problem is to find a good regex with at most 3 digits... which is a very simple one but maybe the description is not clear enough.
If it's not more clear, tell me, I will give you the regex:-)