Ad
  • Custom User Avatar

    Additionally, my solution was accepted without containing any join at all. Perhaps a test case to validate the presence of a join clause would solve that?

  • Custom User Avatar

    The "1A" comes from counting up the first 22 polydivisible numbers in base 16 (the counter of 22 is in base 10 here). That is, if you were to begin counting up from 0 in base 16, 1A would be the 22nd polydivisible number you encounter.

    It's important to understand which base you need to be performing calculations in and at what time. This piece of the description will make your life easier if you carefully consider the implications:

    "The interesting thing about polydivisiblity is that it relates to the underlying number, but not the base it is written in, so if aliens came to Earth and used base 23 (11 fingers on one hand and 12 on the other), no matter what squiggles they used to write numbers, they would find the same numbers polydivisible!"

  • Custom User Avatar

    Don't forget that 0 is considered a polydivisible number.

  • Custom User Avatar

    Once the base increases past 10, you no longer have enough digits in [0..9] to represent a single place in a number, so we must extend the set of digits we use to represent the number. By joining [0..9], [A..Z] and [a-z] we have 62 easily representable "digits" that we can use. We could add more but this kata only uses up to 62.

    The code which tests our solutions declares a constant string named CHARS which contains each possible digit we will be expected to use. You can print the string buy including a statement such as "print CHARS" in your solution, but the contents of CHARS doesn't really matter, only the index of the character we use.

  • Custom User Avatar

    This was by far my favourite kata so far.

    I thought I was so clever with my first attempt, using a simpler "traditional" approach but this kata forced me to think about the task in a completely different way to how I normally would approach it.

    Excellent work!