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.
Yeah this is great! I would be happy to work with this person :]
Man, you deserve respect, well done!
Great solution! I initially tried implementing something similar, but couldn't figure out the right conditions for the loop... I ended up with something way less efficient lol
Easily understandable. Learned from this. Thanks!
I believe the only parts missing are the definitions of constants for the cost of a day and the various discounts. Perhaps also consider using the ternary operator in the discountRate function.
"more code" isn't a big deal if it's not increasing complexity. sure he could have perhaps used ternaries instead of if-else, but what i see at work here is the prevailing desirability of standard syntax.
I really do like it!
This comment is hidden because it contains spoiler information about the solution
Great answer, its really well thought out!
We have the same logic but I didn't know you can put multiple conditionals on for loop. Thanks for the knowledge.
Yes so it will check if k > 0 on every iteration of the loop.
Perhaps an initial check would be better since it doesn't change.
That was really clever how you added i + k to the slice method to group two array elements at each time. I'm going to need use that in my code.
k > 0 is in the conditional part of the for loop
k > 0 is in the conditional part of the loop.
maybe i'm crazy but does this work? "i<=strarr.length-k" is a mistake, it should be "i<=strarr.length-(k-1)" instead, because in a given solution function does not analise the last array item
Loading more items...