Ad
  • Custom User Avatar

    It is just a variable name, it doesn't matter what it is called. If it helps you read it, you can do a rename of it when you are reading it.

  • Custom User Avatar

    Because your code is wrong. Read the description of the Kata again.

  • Custom User Avatar

    Skill issue?

    But yes, this would be a lot easier if the method/function took an int array as input. But then this kata would be even easier and not as fun.

  • Custom User Avatar

    No, I mean you are using the max and min functions on a list of strings. The way you sort a list of strings is different form how you sort a list of numbers.

    See: https://www.codewars.com/kata/554b4ac871d6813a03000035/discuss#60cb692f9c75d0003d7b9a79

  • Custom User Avatar

    Which programming language is this?

    The issue is definitely your code, and my first guess is that you are sorting a list of strings, instead of a list of numbers.

    Other than that, you are doing things in a loop for some reason, so you are finding the highest and lowest values multiple times.

  • Custom User Avatar

    Which programming language? And what was the exact output of the failed test case?

    I highly doubt there is an issue though, unless this is a very recently added translation. Since this kata has thousands of completions.

  • Custom User Avatar

    The Description has been changed, so you need to somehow pull from master? Not completely sure how that is done here.

    Also need you to add an example to the Description. But I can add it myself if it is.

  • Custom User Avatar

    Looks good.

    I am just sad you didn't post as a comment on the kata so I had noticed this sooner.

  • Custom User Avatar

    You need to actually return the result, not print it.

  • Custom User Avatar

    You mean how this website works? How to do a kata in general?

    Or do you mean this kata specifically?

    What is your question?

  • Custom User Avatar

    Look at the Solutions section if you want to compare your solution to others.

  • Custom User Avatar

    You are not returning a value, you are only printing it to the console. You have to actually use the return statement.

    expected undefined to equal '542 -214'

    Means you returned undefined, and not a value.

    Replace your console.log with:

    return `${maxValue} ${minValue}`;
    

    Or whatever your programming language's equivalent of such would be.

  • Custom User Avatar

    Oh yeah, forgot to close this. Merged.

  • Custom User Avatar

    I like that each test can fail individually, so that part I do like.

    I would at least suggest using the old method for the Sample Test Cases though, so it is less confusing for the end users and allow them to edit it easily.

    The actual hidden Test Cases don't have to be as readable as much, as long as they can be maintained.

  • Custom User Avatar

    Reviewed and commented.

  • Loading more items...