This is a verified interview question from Inmobi. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "X of a Kind in a Deck of Cards" covers key patterns like Arrays.
"In a deck of cards, each card has an integer written on it. Given a deck of cards, return true if and only if you can choose 1 so that this integer is equal to the number of other cards of the same type (i.e., the number of 2s is 2, the number of 3s is 3, etc.). ### Example 1: Input: deck = [1,1,1,2,2,3] Output: true ### Example 2: Input: deck = [1,1,2,2,2,3,3] Output: false ### Constraints: - 2 <= deck.length <= 10000 - deck[i] is an integer from 1 to 40000. - All the integers in the deck are equal or there are at least two different integers in the deck."
Join thousands of developers practicing for Inmobi.