Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Because your code is wrong. Read the description of the Kata again.
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.No, I mean you are using the
max
andmin
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
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.
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.
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.
Looks good.
I am just sad you didn't post as a comment on the kata so I had noticed this sooner.
You need to actually return the result, not print it.
You mean how this website works? How to do a kata in general?
Or do you mean this kata specifically?
What is your question?
Look at the Solutions section if you want to compare your solution to others.
You are not returning a value, you are only printing it to the console. You have to actually use the
return
statement.Means you returned
undefined
, and not a value.Replace your
console.log
with:Or whatever your programming language's equivalent of such would be.
Oh yeah, forgot to close this. Merged.
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.
Reviewed and commented.
Loading more items...