Last active
October 31, 2019 08:25
-
-
Save imedadel/602984eab985b15b3ee39b552ada711e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 getTotalX(a, b): | |
| maxN = max(b) | |
| minN = min(a) | |
| sumN = 0 | |
| for number in range(minN, maxN+1): | |
| factorsOfNumber = all([number%x == 0 for x in a]) | |
| multsOfNumber = all([x%number == 0 for x in b]) | |
| sumN += factorsOfNumber * multsOfNumber | |
| return sumN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment