Ad
  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar

    this is due to input mutation

  • Custom User Avatar

    Good example; if I can re-publish the kata I will put that in the description. Thanks!

  • Custom User Avatar

    Your code fails for any single digit input (e.g. n=5). This is because your reduce function tries to take two arguments (x and y, representing the digits) however the input is one digit long and the second argument doesn't have value, therefore it returns the first value as a string. It produces an error from m/10 because it is trying to divide a string.

  • Custom User Avatar

    Your transformation from string to number does not work.
    In the array there could also be negative numbers! Thats the '-'... ;-)

    I hope that helps.

  • Custom User Avatar

    All Katas have an automatic discourse page. All you have to do is click the "Discourse" button from the "Details" tab that you start on. Or you can add /discuss in the address bar after the Kata. Here is the link you want: https://www.codewars.com/kata/sorting-on-planet-twisted-3-7/discuss/.

    From here you can create your own comment thread (you can give a suggestion, report an issue or ask for help) or you can reply to someone's comment by clicking the "Reply" button.

  • Custom User Avatar

    Welcome to Codewars!

    Your code returns string (proof -> <class 'str'> should equal 0) when the expected outcome should be an integer. Simply cast the string -> to integer.

    To post your code in a comment with indentation, use three backticks (`) at the beginning and end of your code - see here for more details.