Primiera (from the french word prime, "prize") is a combination of cards of Scopa, a popular Italian card game.
For establishing the value of the Primiera, a separate point scale is used for selecting the best cards in the player's deck, in each of the four suits and totaling those four cards point values. A Primiera requires at least one card for each suit, otherwise, it can't be calculated.
This is the Primiera points scale:
Create a function that takes in an array representing a cards deck and returns the value of the Primiera.
getPrimieraScore(["Ad", "7d", "5h", "2c", "Ks"]) ➞ 58
// In the diamonds set 7 is higher than Ace (21 > 16).
getPrimieraScore(["2d", "Jd", "7h", "Qc", "5s", "As"]) ➞ 59
// In the diamonds set 2 is higher than Jack (12 > 10), while in
// the spades set Ace is higher than 5 (16 > 15 ).
getPrimieraScore(["2d", "Jd", "Qc", "5s", "As"]) ➞ 0
// There aren't cards in the hearts set, so Primiera can't be
// calculated.