aboutsummaryrefslogtreecommitdiff
path: root/challenge-046/orestis-zekai/python/ch-2.py
blob: b86235f21a697e2148b6e0a3658b14ef3705fc31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
rooms = 500
employees = 500

# The first employee opens all the doors
doors = [1 for i in range(0,rooms)]

for i in range(1, employees):
	j = i
	step = i + 1
	while (j < 500):
		if (doors[j] == 0):
			doors[j] = 1
		else:
			doors[j] = 0

		j += step

print(doors)
print(sum(doors))