Ad
  • Default User Avatar

    Wow. I totally overthought this one.

  • Custom User Avatar

    No offense taken, now that you solved it, do you have a suggestion about how would it be clearer?

  • Default User Avatar

    I was able to figure it out eventually. I mean no offense, it's just not clear when you first read it and look at the examples. But I completed it.

  • Custom User Avatar

    What's the difference between 3 for the price of 2 and buy 3, pay 2 get 1 free? The examples are clear imho. For every 3 mangoes you buy, you only pay 2 and get 1 free.

  • Default User Avatar

    @Chrono79 It's just generally confusing and not well explained. I would consider re-writing the entire desription and making the examples more clearly match the description. It is still confusing.
    Like, is it 3 for the price of 2, or are there free mangoes involved or what? It's just too vague.

  • Custom User Avatar
  • Custom User Avatar

    What's what you don't understand?

  • Default User Avatar

    Yeah I stared at it for five minutes before giving up and reading the comments. Even the 'examples' don't clarify much. I think I'll be skipping this kata.

  • Custom User Avatar

    Check again.

  • Default User Avatar

    Yes, I think adding the $ might be helpful.

  • Custom User Avatar

    Yes, probably. Here they have all kind of "3 for 2", "the second at half price" and many more.

    I though of adding the $ sign to the examples, but I don't know if that would be better or not:

    mango(2, 3) ==> 6    # 2 mangoes for $3 = $6; no mango for free
    mango(3, 3) ==> 6    # 2 mangoes for $3 = $6; +1 mango for free
    mango(5, 3) ==> 12   # 4 mangoes for $3 = $12; +1 mango for free
    mango(9, 5) ==> 30   # 6 mangoes for $5 = $30; +3 mangoes for free
    

    Seeing the examples again, if you buy 2, you don't get one free, see the first example. Only if you grab 3, you get one of those free.

  • Default User Avatar

    Well, where I'm from the stores would usually say "Buy 2 get one free". That presumes that the first two are being paid for and the third one is free. For me, saying "3 for 2" is like saying you are getting 3 for the price of two but there would be no free mangoes. Meaning you would get 3 mangoes for 2 dollars but 2 mangoes would not also be 2 dollars but would be $1.34 or something like that. Probably just a difference in how stores around here say things compared to how they say it wherever you are.

  • Custom User Avatar

    "Buy 2 mangoes get one free" is misleading too. One of those 2 is free? I think pay 2 and get one free is closer to what is asked. But because I'm not a native english speaker, I don't know what's the usual way of writing that. Is "3 for 2" really that strange?

  • Default User Avatar

    Not a great description. Took me 15 minutes to figure out what the 2 sentence description was trying to say. A simple "buy 2 mangoes get one free" would have made more sense to me anyway.

  • Default User Avatar

    I have a total mess for an answer. It works, however. Getting the code to be more efficient was a little bit of a challenge. Overall though, a really good challege. I really liked this kata.

  • Loading more items...