You are given an integer array deck, where deck[i] represents the number written on the i-th card.
You need to partition all cards into one or more groups such that:
1. Each group contains exactly X cards, where X > 1, and
2. All the cards in the same group have the same integer value.
Return True if it is possible to make such a partition, otherwise False.
Input: deck = [1,2,3,4,4,3,2,1]
Output: True
Input: deck = [1,1,1,2,2,2,3,3]
Output: False
Accepted:
Submission: