[Community Puzzle] Playing Card Odds - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @David_Augusto_Villa,validated by @deej26,@Eulero314 and @TBali.
If you have any issues, feel free to ping them.

Solved without using Set.

1 Like

Bonjour,
Tous OK sauf 8 t 9, 9 il n’y a plus de carte et la solution doit etre 40 % … ???
et 8 je trouve :
Nombre de cartes deled : 43 len de deck 9
Nombre de cartes a chercher : 6
67%
et il attend 22% ???
Si vous pouviez me donner quelques explication, merci

In test 9, what remains:
{(β€˜K’, β€˜S’), (β€˜Q’, β€˜H’)}
What’s asked:
{(β€˜J’, β€˜S’), (β€˜K’, β€˜S’), (β€˜Q’, β€˜S’), (β€˜J’, β€˜H’), (β€˜Q’, β€˜H’)}
In test 8, what remains:
{(β€˜4’, β€˜D’), (β€˜T’, β€˜D’), (β€˜4’, β€˜H’), (β€˜K’, β€˜S’), (β€˜Q’, β€˜S’), (β€˜2’, β€˜H’)}
What’s asked:
{(β€˜7’, β€˜C’), (β€˜4’, β€˜D’), (β€˜4’, β€˜H’), (β€˜K’, β€˜S’), (β€˜J’, β€˜H’), (β€˜K’, β€˜C’), (β€˜3’, β€˜S’), (β€˜7’, β€˜D’), (β€˜6’, β€˜S’), (β€˜6’, β€˜C’), (β€˜2’, β€˜D’), (β€˜5’, β€˜C’), (β€˜T’, β€˜S’), (β€˜Q’, β€˜S’), (β€˜2’, β€˜H’), (β€˜Q’, β€˜C’), (β€˜K’, β€˜H’), (β€˜8’, β€˜S’), (β€˜4’, β€˜S’), (β€˜3’, β€˜H’), (β€˜J’, β€˜C’), (β€˜5’, β€˜D’), (β€˜9’, β€˜S’), (β€˜T’, β€˜D’), (β€˜Q’, β€˜H’), (β€˜7’, β€˜S’), (β€˜8’, β€˜D’)}

1 Like

Does anyone know the input of validator 5 when submitting. I pass all the test but stuck at that

It’s very similar to the Impossible test, looking for cards that have been removed. The only significant differences are that the descriptions of cards sought indicate more than one card, and one of those cards it’s looking for, it’s looking for two ways. Does that help?

1 Like

if the percentage is 38.8%, the output should be 38% or 39%??

The puzzle mentions that the percentage should be β€œrounded”, so 39% would be right. However there aren’t actually any situations like that in the tests or validators, where you’d have to round up.

1 Like

Not sure I understand. Do you have ab example perhaps? Does this mean we can ignore removed cards being sought ?

The best example is the fifth test, Impossible, which seeks cards that have been removed. I don’t know if β€œignore” is the most precise term, but certainly if the card you’re looking for has been removed from the deck, you’re not going to find it.

Oh thanks. That helped. I’m sorted! :smile:

1 Like

Hi, I passed all the tests but when I tried to validate, I couldn’t validate the 9th validator but I don’t know why? Can someone please help me?

Strange, it’s very similar to the last test. You can message me with your code if you like. Update: Resolved, good job!

1 Like

I have passed all tests but cannot pass test 8’s validator. Can you give me a hint?

You can send me your code (in private), I’ll send back what’s wrong.

Because people are having trouble especially with the last two tests and validators, I’m going to change the puzzle β€œtomorrow” (i.e. sometime next year) to expose current validators 8 and 9, creating four new validators for those test cases, and insert several more simpler tests which might help to expose any issues earlier.

1 Like