This Coding & Algorithms question evaluates algorithmic reasoning about combinatorial search and multiset partitioning, testing the candidate's ability to represent and manipulate tile counts and validate pattern-based groupings.
You are given an integer array tiles of length 14 representing a Mahjong-like hand. Each integer is a tile value from 1 to 9 (single suit). You may reorder the tiles.
A hand is winning if it can be partitioned into:
Each tile can be used at most once.
Return true if the hand is winning, otherwise return false.
Assumptions/constraints:
tiles.length == 14
1 <= tiles[i] <= 9