Count Distinct Hat Assignments and Maximize Hat Points

Given n people and m hats, hat h has value points[h]. Each person has a list of hats they are willing to wear.

Assign exactly one acceptable hat to every person such that no hat is assign...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: