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.
welldone!
well needed some time to understand,
this is fkn genius ngl
That is short and effective solution, instead of looking for minimal and maximal values you gust sort array. And alghorithms of sorting usually work faster with almost sorted arrays. So your program may be one of the quickest, even if queues are very long.
Bad code.
I had to make a solution like this too, because of the long data type. I had originally had good, concise solution, but had to use a brute force solution like this.
my solution same as this, but i did not sort that result array ,so a little complect
GG, i had the same idea, but its the simple code, GGWP
Nice job. I hope I am not the one to come in behind you and have to update it.
Please, someone explain what means this "x" at the beginning
What a fucking genius GG nice solution
yes the while loop will break if the f0 is below or equal to 0 or if n becomes 0
or both so if the loop breaks by n becoming 0 then still the f0 is larger than 0 so true else if f0 becomes 0 or below the loop breaks and then if n is 0 returns true else false.
I'm pretty sure Java does have precendence in the order in which terms are evaluated. It's what allows us to do stuff like this where we can "nest" statements and change multiply fields of the code without worrying about the order in which it happens.
https://introcs.cs.princeton.edu/java/11precedence/
edit: I agree that it's not best practice, definitely shouldn't be used in a real-world application, but for a simple kata it's useable.
This comment is hidden because it contains spoiler information about the solution
To be really, really sure that Java uses double division instead of integer division by some unforeseen accident or changing method signatures in JDK 46 providing a
Math.pow
which operates solely on integers. Principle of least surprise.Just FYI, you did not had to trim out the spaces in "time", if you had split it as: ", " rather than ",".
Loading more items...