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.
This comment is hidden because it contains spoiler information about the solution
An interesting kata on first glance, but hard to implement because the spec for the shifting algorithm is unclear. It says that each “plaintext letter” is shifted, but does not specify a) what a plaintext letter actually is and b) in which order they appear in the alphabet. My guess is a-z from the English alphabet, but that’s just a guess. Since that information is a vital part of the algorthim, it should be added to the description.
Clever! That’s what you get when you take TDD too literally. :D
A little too clever for its own good. Because how map’s operator[] works this inserts every non-smiley string into the map, growing it continuously. In the real world something like this can be the cause of a crash or mysterious slowdown that happens once each day/week/month and is virtually impossible to reproduce.
But it’s a great example for why using
const
as often as possible is an excellent idea. Ifmp
wasconst
the code wouldn’t have compiled and the bug wouldn’t be out in the wild.