Yu-Gi-Oh! kata: kaiba's Ultimate dream
Description:
this Kata is based on the famous trading card game Yu-Gi-Oh!
This Kata's objective is to help the legendary duelist "Seto Kaiba" to figure out if he can use his most powerful card "Blue-eyes Ultimate Dragon !!" starting from a given duel situation
to summon the Ultimate, kaiba needs (at least) three exemplaries of "Blue-eyes white dragon" together with one "polymerization" card
u r given the following informaition *) a list of strings representing kaiba's hand as follows -)"BEWD" for blue-eyes white dragon -)"poly" for polymerization -)"xx" for any other card" *)the number of cards left in deck(d) *)the number of blue-eyes cards left in deck(b) *)the number of polymerization cards left in deck(p)
your task in to write a function "ultimaProb" that takes those parameters & returns the minimum number of turns after which the probability of Kaiba having the necessary cards exceeds (or is equal ) to 50% (one random card is added from the deck to the hand each turn)
you should conseder the following cases: *) Kaiba may have all the necessary cards from the start , in this case return 0 *) Kaiba could face a situation where it is impossible to summon the Ultimate dragon( deck+hand does not contain the necessary cards) in this case return -1
good luck, the world champion's countin' on ya :)
Similar Kata:
Stats:
Created | Jun 16, 2017 |
Warriors Trained | 126 |
Total Skips | 5 |
Total Code Submissions | 212 |
Total Times Completed | 5 |
Python Completions | 5 |
Total Stars | 5 |
% of votes with a positive feedback rating | 50% of 1 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 2 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 6 kyu |