Given a set of tiles (represented by numbers from 0 - 9), a valid configuration of tiles for success at this game happens only when the entire set can be divided such that:
Eg:-
Set of tiles : 11123
Output : True , as above set of tiles can be 11 (pair) and 123 (increasing triple)
Set of tiles : 11111
Output: True, as above set of tiles can be 11(pair) and 111(triple)
Set of tiles : 1123
Output: False , as the above set can be divided into a pair (11), but (23) are extra.
I tried branching on the above set, s.t. at each step we either pick a pair or not pick a pair, but my solution was not correct.
Can anyone please help what should be the correct approach for this problem?