Select Cells in Grid With Maximum Score
Process each distinct value once, tracking the set of rows already used as a bitmask, so no value repeats and no row repeats.
Process each distinct value once, tracking the set of rows already used as a bitmask, so no value repeats and no row repeats.