Skip to content

Commit d0b8edf

Browse files
committedJan 5, 2019
Modified #171
1 parent 7e06d95 commit d0b8edf

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed
 

‎challenges/busiest-time-in-building.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Test case generated using: https://gist.github.com/subsr97/013f0ec962ebc2f30f26e2ea73c2a4f7
2020
Entry Count: 10
2121
Entries:
22-
[
22+
[
2323
{'timestamp': 1546711314, 'count': 1, 'type': 'enter'},
2424
{'timestamp': 1546711379, 'count': 3, 'type': 'enter'},
2525
{'timestamp': 1546711496, 'count': 1, 'type': 'exit'},
@@ -29,7 +29,8 @@
2929
{'timestamp': 1546711764, 'count': 5, 'type': 'exit'},
3030
{'timestamp': 1546711778, 'count': 3, 'type': 'exit'},
3131
{'timestamp': 1546711799, 'count': 3, 'type': 'enter'},
32-
{'timestamp': 1546711851, 'count': 5, 'type': 'exit'}]
32+
{'timestamp': 1546711851, 'count': 5, 'type': 'exit'}
33+
]
3334
People List: [0, 1, 4, 3, 2, 5, 10, 5, 2, 5, 0]
3435
Answer: (1546711755, 1546711764)
3536
"""
@@ -62,15 +63,16 @@ def busiestTime(entries):
6263

6364
def main():
6465
entries = [
65-
{'timestamp': 1546707529, 'count': 1, 'type': 'enter'},
66-
{'timestamp': 1546707546, 'count': 3, 'type': 'enter'},
67-
{'timestamp': 1546707565, 'count': 1, 'type': 'enter'},
68-
{'timestamp': 1546707594, 'count': 2, 'type': 'exit'},
69-
{'timestamp': 1546707672, 'count': 3, 'type': 'enter'},
70-
{'timestamp': 1546707781, 'count': 1, 'type': 'exit'},
71-
{'timestamp': 1546707806, 'count': 4, 'type': 'exit'},
72-
{'timestamp': 1546707915, 'count': 4, 'type': 'enter'},
73-
{'timestamp': 1546707961, 'count': 5, 'type': 'exit'}
66+
{'timestamp': 1546711314, 'count': 1, 'type': 'enter'},
67+
{'timestamp': 1546711379, 'count': 3, 'type': 'enter'},
68+
{'timestamp': 1546711496, 'count': 1, 'type': 'exit'},
69+
{'timestamp': 1546711578, 'count': 1, 'type': 'exit'},
70+
{'timestamp': 1546711673, 'count': 3, 'type': 'enter'},
71+
{'timestamp': 1546711755, 'count': 5, 'type': 'enter'},
72+
{'timestamp': 1546711764, 'count': 5, 'type': 'exit'},
73+
{'timestamp': 1546711778, 'count': 3, 'type': 'exit'},
74+
{'timestamp': 1546711799, 'count': 3, 'type': 'enter'},
75+
{'timestamp': 1546711851, 'count': 5, 'type': 'exit'}
7476
]
7577

7678
print(busiestTime(entries))

0 commit comments

Comments
 (0)