Created
October 22, 2020 16:44
-
-
Save dalequark/c369014eb3b0a5ce0c4d77eb3ab4af07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def canAddItem(existingArray, newType): | |
bottoms = {"pants", "skirt", "shorts", "dress"} | |
newType = newType.lower() | |
if newType in existingArray: | |
return False | |
if newType == "shoe": | |
return True | |
if newType in bottoms and len(bottoms.intersection(existingArray)): | |
return False | |
if newType == "top" and "dress" in existingArray: | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment