Number of Ways to Wear Different Hats to Each Other
DescpitionTherearenpeopleand40typesofhatslabeledfrom1to40.Givenalistoflistofintegershats,wherehats[i]isalistofallhatspreferredbythei-thperson.Returnthenumberofwaysthatthenpeopleweardifferenthatstoeach