Skip to content

Instantly share code, notes, and snippets.

@amulyakashyap09
Created December 30, 2017 20:48
Show Gist options
  • Save amulyakashyap09/3a80e4d9d2ce96dac889c86ed2e1e91a to your computer and use it in GitHub Desktop.
Save amulyakashyap09/3a80e4d9d2ce96dac889c86ed2e1e91a to your computer and use it in GitHub Desktop.
Print all possible combinations | hackerrank
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