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.
Bazinga!!!!
I knew it was too good to be true.
Thanks for pointing that out.
This algorithm is incorrect.
It passes only because of the limited testing required on submission.
The 4, 9, 40, 90 etc that you are trying to catch with (p<c) can only be done in the first position.
Test.assertEquals(solution('CMXCIX'), 999, "Your algorithm gives an answer of 1021 and fails on this test.");
I noticed the same thing, so I just did lessons from http://regexone.com/problem/trimming_whitespace.
As soon as I finish their problems set, I look forward to redoing many of my lower level katas.
If I still need regex help, I've got http://qntm.org/files/re/re.html and http://regex.learncodethehardway.org/book/ queued up.
I didn't realize that anonymous functions were getting autonamed. That could be frustrating.
This really was one of the most chalenging Katas I've ever tried, though. I think if maybe the description was a little more explicit on what would or wouldn't work, that would make it more fun.
Thanks for tHe feedback! I do plan on going some tweats at some point. The kata was written before ES6 support (Babel) was introduced, and as I can't turn it off it broke quite a few things that were perfectly valid before (like anonymous functions, they now get auto named).
Now that I've completed the Kata, I have a few remarks
Great kata, though. I hope to never do it again.
Best comments so far, go to you.
I get the same result. I just have the thing return itself and I get an error, making me think that the name of the variable is a problem.
Maybe my description wasn't the best. I understood really well what the Caesar was and how it worked. I just wasn't seeing its relationship to the Vigenère. And yeah, "The shift is derived by applying a Caesar shift to a character with the corresponding index of the key in the alphabet." now makes sense.
I had to look at the example on wikipedia and manually perform an encryption before I understood exactly how the cypher worked. And the best way that it worked in my head was, "oh, it's basic addition and subtraction."
I didn't realize the difficult was the same across languages. Interesting.
After re-reading the description, it seems like it could be made more clear. However, I'm not sure if your suggested changes to the description accomplish that. I'll be sleeping on it, particularly in regard to this sentence and the following example recommended previously "The shift is derived by applying a Caesar shift to a character with the corresponding index of the key in the alphabet."
Edit: In regard to difficulty, it was determined by the beta process, and it seems to fall in line with other cipher katas. It should also be noted that, although this was published before Python was supported on Codewars, that this kata is much harder in Python because Unicode support sucks in Python 2.x.
this was a really fun Kata. seemed a little easy for a 4 Kyu kata, though.
The description of the cypher was a little confusing though. I had to go to wikipedia and read the page to really understand how the cipher worked.
Maybe if it explained the cipher something like:
A Caesar cipher shifts all letters in the string n spaces.
A Vigenère cipher shifts each individual letter in the string n space, where n is calculated as "index of the original letter in the string + index of the letter in the key"
A Caesar encrption can use a shift value of 3, turning 'dog' (3,14,6) into 'grj' (6,17,9)
But Vigenère uses the key 'pup' (15,20,15) to turn 'dog' (3,14,6) into 'siv' (18,8, 21).
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It seems to be the current mainstream belief that the power of abstraction required by regular expressions and functional programming displays superior problem solving ability than old-timer loop solutions manually covering edge cases. I happen to strongly share in that belief as an old-timer stateful programmer myself. I believe in doing everything we can to push ourselves to the next level of excellence.
Loading more items...