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.
Great solution, also love the comments
This does not work with newer tests. If a or b is the largest value like here in the test PythagoreanTriple(5,3,4) this equals to false, but it should equal to true.
True, they are useless here. Just return the result of the comparison.
But you defined new variables yourself
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
This solution seems to be a one line of code that solves the problem. It should have more best Practices upvotes.
This comment is hidden because it contains spoiler information about the solution
This idea is similar to what I did, but you do not need the ternary operator for the return. If the strings are equal, then it will automatically return true, false otherwise.
Also, defining new variables is unecessary. Just return the comparison.
why? I don't see a picture of you there.
This is the pure reason why switch statement exists. It is so messy and needs a refactoring. Should not have so many best practices upvotes. Also, there are much more cleaner solutions.