Nov-17-2022, 08:40 PM
I have a list that compared from 3 lists that compered from 0,1,2
like that:
1 cant be next to another number
2 can be next to another 2
I tried to do it with the first line unsuccsefully
someone can please tall me whats wrong with it?
like that:
[ [0, 0, 2, 2, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0] ]0 can be next to all numbers
1 cant be next to another number
2 can be next to another 2
I tried to do it with the first line unsuccsefully
def verify_seating_arranngment(cinema): line_1 = cinema[0] line_2 = cinema[1] line_3 = cinema[2] for i in line_1: if i ==1 and i+1== 1: return False print(verify_seating_arranngment([ [0, 0, 2, 2, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 0] ]))
someone can please tall me whats wrong with it?