List Comprehensions
Let's learn about list comprehensions! You are given three integers X, Y and Z representing the dimensions of a cuboid along with an
integer N. You have to print a list of all possible coordinates given by (i, j, k) on a 3D grid where the sum of i + j + k is not
equal to N.
Here, 0 less than or equal to i less than or equal X;
0 less than or equal j less than or equal Y;
0 less than or equal k less than or equal Z
Input Format
Four integers X, Y, Z and N each on four separate lines, respectively.
Constraints
Print the list in lexicographic increasing order.
Sample Input
1
1
1
2
Sample Output
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 1]]
On this page of the site you can watch the video online HackerRank Python Problem No5 || List Comprehension with a duration of hours minute second in good quality, which was uploaded by the user Bhanu Prathap 31 August 2021, share the link with friends and acquaintances, this video has already been watched 10,628 times on youtube and it was liked by 118 viewers. Enjoy your viewing!