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.
At first I thought I was supposed to take the deduction every day it went over the threshold, but it turns out the solution was a lot simpler than that
The Description is not clear enough
In deducts, you should mention that the client will have dedcuts for one time only
and give examples with big numbers to clearify the idea
because first I thought I will get 50 pounds off for every 7 days and the remains if they are 3 or more I will get 20 pounds off, as this will be the real life situation
I marked it as an issue as the logic is not easy to understand
This comment is hidden because it contains spoiler information about the solution
so... you can make something stupidly wrong like I did on my second attempt, but it will be flagged as correct, since the range for the random test is stupidly big. I suggest reducing the range for the random tests, or making some of them smaller then 7, if possible
In the second condition you have to check with (And "&") instead of (OR)
If the 3 day discount took precedence, the 7 day discount would never be applied.
It worked for me tho I found it unfair for user with 20 and 10 days rental get equal fee reduction of $50. It would be good if the (amount to be decreased for both 3 and 7 or more days) is dependent on the multiples of the days. This would make user with 20 days get twice reduction than 10 and the same goes to 3 days discount.
And for those who are wondering how to discount for higher numbers with both 3 and 7 days discounts, it would be simpler if the higher discount among the two (refering to 3 or 7 days) would be chosen.
JUST A SUGGESTION... * _ * + _ + * _ *
there is issue for 7 or more days
If you don't keep the data types and the method's name, then it won't work. The tests look for that. Normally initial code shouldn't make it more difficult for you. If you write your code in your IDE from scratch, then you have the extra work to adapt it to the initial code here.
Not a kata issue, please use the initial code and write your code inside it.
Also, the input value is passed as the argument of that function, not read from the keyboard. Please read this: https://docs.codewars.com/getting-started/solving-kata
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
0 is neither a positive nor negative integer and according to this -->
You are given an array with positive numbers
, such solutions make perfect sense in the context of this kata, hence not an issue! (I'll reject the fork in the meantime)this doesnt specifiy which offer takes precedence, the 7 day one or the 3 day one.
good
Loading more items...