Archives

Algorithm for counting number of decks in a given pack of cards

this.decksOfCards([“2S”, “2C”, “2D”, “2H”, “3S”, “3C”, “3D”, “3H”, “4S”, “4C”, “4D”, “4H”, “5S”, “5C”, “5D”, “5H”, “6S”, “6C”, “6D”, “6H”, “7S”, “7C”, “7D”, “7H”, “8S”, “8C”, “8D”, “8H”, “9S”, “9C”, “9D”, “9H”, “TS”, “TC”, “TD”, “TH”, “JS”, “JC”, “JD”, “JH”, “QS”, “QC”, “QD”, “QH”, “KS”, “KC”, “KD”, “KH”, “AS”, “AC”, “AD”, “AH”, “2S”, “2C”, “2D”, […]

single lane highway

The problem statement isn’t clear. In the given example, 11 groups are cited but the count is only 10. Also, explain in detail what do you mean by groups and how are they formed for this problem statement to be able for us to solve this problem for you.