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.
*GOOD
It's certainly not the clearest, especially the part about the "initial value". It makes sense in the context of a sum, but what about a GCF or LCD? What's an initial value got to do with a max or min?
This might [ wongly ] be classified as a "much more efficient solution".
Pumping up the random tests to
500 000
times, I was unable to discern any difference in speed.Because both solutions are
O(n)
, having larger tests should not be necessary; having more tests should adequately show any performance differences.Input data was being logged to the console - I took that out.
No, there are not. It doesn't matter if you walk the list once or a fixed, limited number of times; it's still
O(n)
. Microoptimisations do not affect the Big-O complexity.A decent compiler ( which Node might not have, but eg. Haskell does ) would only walk the list only once anyway. It's a simple transformation. Don't optimise prematurely.
This searches through the list for each age it needs to check though; there are much more efficient solutions so whilst it's readable I don't think it can be called the best.
8 kyu?
the task is not too hard.
even iam a newbie can do this.
the problem was only in math.ceil cause i know only round and floor, and in zero input
formula isnt hard, people(not programmers of mathematics) do this everyday when choose wallpapers
to those who writes about ceiling and floor
Omg! its a wallpaper! not floorpaper or ceilingpaper! wtf!
generally, you can just ignore this message
It took me more than that xd.
Please read the posts below, it's been explained more than once.