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.
Neat and clean kata to solve, I guess.
this input is impossible in this kata, there is exactly one duplicate
i removed those restrictions from Python, JS and the description
removed
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) andArray.prototype.sort()(JavaScript)Set.differenceis not implemented in node 18, it wasn't added until node 22.JAVASCRIPT : set1.difference(set2) is not a function 💀
I'm sorry. I undestand, where my problem was.
Hi!
This has been discussed in another comment: https://www.codewars.com/kata/55191f78cd82ff246f000784/discuss#67a3c5dc5ff41c3448f49b83
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.
Very interesting kata to practice some object oriented programming with, I think.
Emm... how am I expected to modify the input array without mutating it?
1
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.
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...