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.
Whenever possible, use switch is the best practice. Firstly, readability, and secondly, switch works more efficiently than if - else chains, since with if else the performer does not know in advance which condition will suit him, everything is calculated in runtime, but when using switch, the performer almost instantly chooses what came up according to the condition :) Good luck in your studies!
This comment is hidden because it contains spoiler information about the solution
Fixed
This comment is hidden because it contains spoiler information about the solution
sure ... this isn't standard code, but you gotta give him some credit. These puzzles aren't necessarilly meant to be solved as quick as you can with completely readable code. The different solutions and different types of solutions make these problems fun. In my opinion this one line solution . . looks pretty sweet, and it's amazing it works. And who really cares if we don't understand the equation, that is how we explore and learn different/better/faster solutions
I agree with fxrbfg .. not every programmer remembers mathematical formulas. and while this is very clever, it should be readable for every "average" programmer so they can understand the solution. :)
Fixed.
If we are not talking about performance because benchmark.js shows this:
Repeat slows down by 25 percent. Of course, if we still continue talking about performance we have to avoid template strings ;)
You can find the source code of benchmark here: https://gist.github.com/vatson/e1b83b12601278efc9a8afdba111e1d5
Especially because the abstract class is pretty useless and there is absolute no attribute. Some of the other tags are questionable, too, e.g. Arrays and Regular Expressions which tell us possible ways to solve it but they wouldn't have to be used necessarily.
What do you mean? Java tests has no type problems. Input
char
, outputString
. All the tests follow this format.Closing.
Please provide the langage you used for this kata.
This kata was probably approved in another langage and a translation has been written for the langage you have an issue with.
totally agree, but i just felt like playing with spliterators
This comment is hidden because it contains spoiler information about the solution
You probably meant, that the sample test method is missing a return type, which is what @dinglemouse critized already. I agree that this should be fixed.
Not an issue
Loading more items...