Skip to main content
2 of 3
added 21 characters in body
kglr
  • 400.5k
  • 18
  • 488
  • 929
lsts = Join[Thread[{Join[Range[5], Range[8, 10]], "sing"}], 
   Thread[{Range[6, 10], "dance"}]];

Length @ 
  Select[
    Count[Last /@ #, "sing"] == 2 && 
    Count[Last /@ #, "dance"] == 2 && 
    CountDistinct[First /@ #] == 4 &] @
  Subsets[lsts, {4}]
199
kglr
  • 400.5k
  • 18
  • 488
  • 929