Having just watched the PDC World Darts Championship, Adam has become inspired to become the next Gerwyn Price and takes to the dartboard.
Create a function convert the text information of what Adam has thrown in his three darts into the number of points scored.
For those familiar to watching darts on TV...
You will see a string with three passages of text in the same format as the bar that comes on the screen when a player is on a checkout.
For those not familiar to a dartbord and/or not familiar to watching darts on TV...
You will see a string with three passages of text separated by a space. Each of the three passages of text shall be in one of the following five formats:
1 to 20 (inclusive).17 means single 17 which is 1 x 17 = 17.1 to 20 inclusive with the letter D in front.D12 means double 12 which is 2 x 12 = 24.1 to 20 inclusive with the letter T in front.T9 means treble 9 which is 3 x 9 = 27.25 which is the common name for the outer bullseye.BULL which is the common name for the inner bullseye.howManyScored("BULL 10 T1") ➞ 63
// 50 + (1 x 10) + (3 x 1) = 63
howManyScored("D10 T12 15") ➞ 71
// (2 x 10) + (3 x 12) + (1 x 15) = 71
howManyScored("14 25 T8") ➞ 63
// (1 x 14) + 25 + (3 x 8) = 63