Ad
  • Custom User Avatar

    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

  • Custom User Avatar

    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

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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

  • Default User Avatar

    In the second condition you have to check with (And "&") instead of (OR)

  • Custom User Avatar

    If the 3 day discount took precedence, the 7 day discount would never be applied.

  • Default User Avatar

    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... * _ * + _ + * _ *

  • Default User Avatar

    there is issue for 7 or more days

  • Custom User Avatar

    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.

  • Custom User Avatar

    Not a kata issue, please use the initial code and write your code inside it.

    /* d - the days to rent */
    unsigned rental_car_cost(unsigned d)
    {
        return 0u;
    }
    

    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

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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)

  • Custom User Avatar

    this doesnt specifiy which offer takes precedence, the 7 day one or the 3 day one.

  • Default User Avatar
  • Loading more items...