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.
Dude , thanks for writing this comment. I'm more silly because I had in the instructions "If the score < 0, return 0" but still came here to check if something is wrong when I get -3
Not once you've been answered.
I'm stiupid XD omg thank you
Can i delate my comments?
This comment is hidden because it contains spoiler information about the solution
I think some test cases are wrong.
test.assert_equals(check_exam(["b", "c", "b", "a"], ["", "a", "a", "c"]), 0)
it should equal -3 not 0.
Tell me if i'm wrong
Well, if your goal was to do it in one line, you definitely got it. I often try for one-line solutions, personally, even though those solutions usually aren't best practice.
"Best practices" doesn't usually mean do the task in as little code as possible, it generally means do the task in a way that is easy for someone else to figure out what you're doing and also to make the code easy to maintain if you have to change it in the future. It's also a best practice to pay attention to performance, and you usually have to balance maintainability with performance.
Your solution could be easier to read. You also end up doing the same work twice by generating the same exact list two separate times. You could just generate one list and pull both the max and min numbers out of it. Having to generate one list would also save you time in the future should you need to change this code. For example, if this were part of a larger project, and your team decided that this method would be passed a list of ints instead of a string, right now you've got two changes to make in your code, but if you'd done it the other way, you'd only have to make one change.
I wouldn't put TOO much stock in the answers that are the highest upvoted for "best practices". People often upvote solutions that work, but are not "best practices", either because the solution was funny, or clever(even though there's a separate upvote for that), or the solution is very short, or any number of other reasons. I've seen incredibly inefficient code get the top spot for "best practices" before (like n^2 time complexity where an n or even a 1 time complexity could be achieved).
I'm using Python
You'll have tell us which programming language you are using, or else we can't see your solution.
Otherwise if you just want to see other peoples solutions to the kata, you can check the Solutions tab. There you will find all user submitted solutions and rate or comment on them.
The most voted best practice and clever solutions will be listed at the top.
Hello!
I'm very new to programing but i want to learn as much as I can c:.
It's my first time ever using list comprehension! Can someone more experienced tell if my answer is good practices?
Or maybe i can improve something, read about usefull methods?
I did some reading and thank you! I know understand that it is correct
No, it's fine.
No, it doesn't, the reason is it returns either way, so only the first letter is checked.
Loading more items...