Ad
  • Custom User Avatar

    I think there are several issues with this translation:

    • The solution function should be called SquareSumsRow(), as the description says.

      Maybe that name isn't perfect, but it's not terrible either. There's no good reason to change it. And the name GetPermutation() doesn't make sense. That's not what the function does.

    • The full solution should compute the result, not just look it up in a precomputed table.

      I think a kata solution should show users an example of a good solution. A table of results that has been computed by some other code we don't get to see feels almost like cheating.

    • The verifier code should be in the tests, not in preloaded code.

      That's a matter of taste. There are many katas that put such code into the preloaded code, but that often means that users trying to solve a kata are kept in the dark about what's being tested. Sure, keeping that code in the tests leads to code duplication between example tests and full tests, but it helps users understand what's going on, and it lets them adapt the tests to their needs.

  • Custom User Avatar

    I think there are several issues with this translation:

    • The solution function should be called SquareSumsRow(), as the description says.

      Maybe that name isn't perfect, but it's not terrible either. There's no good reason to change it. And the name GetPermutation() doesn't make sense. That's not what the function does.

    • The full solution should compute the result, not just look it up in a precomputed table.

      I think a kata solution should show users an example of a good solution. A table of results that has been computed by some other code we don't get to see feels almost like cheating.

    • The verifier code should be in the tests, not in preloaded code.

      That's a matter of taste. There are many katas that put such code into the preloaded code, but that often means that users trying to solve a kata are kept in the dark about what's being tested. Sure, keeping that code in the tests leads to code duplication between example tests and full tests, but it helps users understand what's going on, and it lets them adapt the tests to their needs.

  • Custom User Avatar
  • Custom User Avatar

    .

  • Custom User Avatar

    rejected because not conform with the current version of the kata. If you can update it to make it consistent with either JS or python, that's ok.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar