|
19 | 19 | Test case generated using: https://gist.github.com/subsr97/013f0ec962ebc2f30f26e2ea73c2a4f7
|
20 | 20 | Entry Count: 10
|
21 | 21 | Entries:
|
22 |
| - [ |
| 22 | +[ |
23 | 23 | {'timestamp': 1546711314, 'count': 1, 'type': 'enter'},
|
24 | 24 | {'timestamp': 1546711379, 'count': 3, 'type': 'enter'},
|
25 | 25 | {'timestamp': 1546711496, 'count': 1, 'type': 'exit'},
|
|
29 | 29 | {'timestamp': 1546711764, 'count': 5, 'type': 'exit'},
|
30 | 30 | {'timestamp': 1546711778, 'count': 3, 'type': 'exit'},
|
31 | 31 | {'timestamp': 1546711799, 'count': 3, 'type': 'enter'},
|
32 |
| - {'timestamp': 1546711851, 'count': 5, 'type': 'exit'}] |
| 32 | + {'timestamp': 1546711851, 'count': 5, 'type': 'exit'} |
| 33 | +] |
33 | 34 | People List: [0, 1, 4, 3, 2, 5, 10, 5, 2, 5, 0]
|
34 | 35 | Answer: (1546711755, 1546711764)
|
35 | 36 | """
|
@@ -62,15 +63,16 @@ def busiestTime(entries):
|
62 | 63 |
|
63 | 64 | def main():
|
64 | 65 | 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'} |
74 | 76 | ]
|
75 | 77 |
|
76 | 78 | print(busiestTime(entries))
|
|
0 commit comments