In BlackJack, cards are counted with -1, 0, 1 values:
2,3,4,5,6are counted as+17,8,9are counted as010,J,Q,K,Aare counted as-1
Create a function that counts the number and returns it from the list of cards provided.
count([5, 9, 10, 3, "J", "A", 4, 8, 5]) ➞ 1
count(["A", "A", "K", "Q", "Q", "J"]) ➞ -6
count(["A", 5, 5, 2, 6, 2, 3, 8, 9, 7]) ➞ 5- String inputs will always be upper case.
- You do not need to consider case sensitivity.
- If the argument is empty, return
0. - There will be no input other than:
2,3,4,5,6,7,8,9,10,"J","Q","K","A".