Created
December 30, 2017 20:48
-
-
Save amulyakashyap09/3a80e4d9d2ce96dac889c86ed2e1e91a to your computer and use it in GitHub Desktop.
Print all possible combinations | hackerrank
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
import sys | |
if __name__ == '__main__': | |
a = int(input()) | |
b = int(input()) | |
c = int(input()) | |
n = int(input()) | |
print([[x,y,z] for x in range(a + 1) for y in range(b + 1) for z in range(c + 1) if x + y + z != n]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment