1 # 6. How many names are subsets of other names?
3 # Note: this problem gets really slow when you consider boys and girls names
4 # together. For simplicity, I'm treating them separately.
9 for boysName in ssadata.boys.keys():
10 for otherBoysName in ssadata.boys.keys():
11 if boysName in otherBoysName and otherBoysName != boysName:
12 boysNamesSubsets = boysNamesSubsets + 1
15 for girlsName in ssadata.girls.keys():
16 for otherGirlsName in ssadata.girls.keys():
17 if girlsName in otherGirlsName and otherGirlsName != girlsName:
18 girlsNamesSubsets = girlsNamesSubsets + 1
20 print(str(boysNamesSubsets) + " boys names are subsets of other boys names.")
21 print(str(girlsNamesSubsets) + " girls names are subsets of other girls names.")