Ad
  • Default User Avatar

    My initial instinct was to implement something similar to yours but decided the code was too complex and doing too many unnecessary calculations. So I switched it to a simple substitution and capped my table to meet the requirements of the kata (actually I over-engineered it by one entry). This doesn't make mine right and yours wrong, we're just solving it around different priorities.

  • Default User Avatar

    I'd probably do a couple of things differently if this was production code, but I would keep the symbols in an encoding table. Why calculate the same values over and over again?