Ad
  • Custom User Avatar
  • Custom User Avatar

    Neat and clean kata to solve, I guess.

  • Custom User Avatar

    this input is impossible in this kata, there is exactly one duplicate

  • Custom User Avatar

    i removed those restrictions from Python, JS and the description

  • Custom User Avatar
  • Custom User Avatar

    You are not allowed to sort the array.

    makes no sense since sets are not also banned. it's also un-enforceable. this should be removed from the description. currently, all that is done is disabling sorted() (Python) and Array.prototype.sort() (JavaScript)

  • Custom User Avatar

    Set.difference is not implemented in node 18, it wasn't added until node 22.

  • Custom User Avatar

    JAVASCRIPT : set1.difference(set2) is not a function 💀

  • Custom User Avatar

    I'm sorry. I undestand, where my problem was.

  • Custom User Avatar
  • Custom User Avatar

    Hello. Why in this case [{ name: 'Bob', scores: [ 10, 65 ] }, { name: 'Bill', scores: [ 90, 5 ] }, { name: 'Laurel', scores: [ 5, 12 ] }] should I get "false" ? My algotitm gets "Bill" and that is wrong.

  • Custom User Avatar

    Very interesting kata to practice some object oriented programming with, I think.

  • Custom User Avatar

    Remarks:

    • You are not allowed to mutate the array.
    • Ideally, your solution should not use extra space except the one provided by the input array (which can be modified).

    Emm... how am I expected to modify the input array without mutating it?

  • Custom User Avatar
  • Custom User Avatar

    If any single spin scores over 100, the entire input is invalid because scoring over 100 in a single spin is impossible according to the rules of the game. The situation described by the entire input is impossible. There are no players being punished, this isn't a game happening in real time, this is the results of a game being reported to your function. Because the input received by your function is impossible, the entire game is invalid.

    What SHOULD happen to the contestants in such a game is outside of the scope of this function. In a real world scenario, if this would happen, it's likely that the game show runners would make everyone re-spin because the wheel was found to be invalid. Somehow, a wheel with a value above 100 snuck its way onto the show. Your function is not required to make this decision, the function is only specced to report this situation as invalid. If this were a computer game, as a programmer, you could conclude that you have a bug somewhere else in the code, or you could come to a conclusion that one of the players were cheating, but without more information, it's impossible to say who it is (and it wouldn't be the job of this function to determine the cheater anyway). In this case, you'd still want to report this game as invalid.

    If a single over-100 score from a single player results in the entire game being returned "false," then why does the description even account for the case where ALL players break 100?

    It's not a single score (score being the result of two spins) being over 100 that results in false. It's possible for someone's score to be over 100 (for example, if they got two 70's), this would not invalidate the game. It's a single spin being over 100 that invalidates the game (again, because this should be impossible, meaning something went wrong before the scores ever got to your function).

  • Loading more items...