You are viewing a single comment's thread. Return to all comments →
from itertools import product
def get_coordinates(x: int, y: int, z: int, n: int) -> list:
result = product(range(x+1), range(y+1), range(z+1)) return [list(v) for v in filter(lambda x: sum(x) != n, result)]
if name == 'main':
x = int(input()) y = int(input()) z = int(input()) n = int(input()) print(get_coordinates(x, y, z, n))
Seems like cookies are disabled on this browser, please enable them to open this website
List Comprehensions
You are viewing a single comment's thread. Return to all comments →
from itertools import product
def get_coordinates(x: int, y: int, z: int, n: int) -> list:
if name == 'main':