Last active
December 12, 2018 10:49
-
-
Save hansrajdas/6b8a5d29329aa75409560df612c085a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def howManyAgentsToAdd(noOfCurrentAgents, callsTimes): | |
_min = sys.maxint | |
_max = -sys.maxint | |
start = 0 | |
end = 1 | |
for c in callsTimes: | |
if _min > c[start]: | |
_min = c[start] | |
if _max < c[end]: | |
_max = c[end] | |
calls = [-1 for i in range(_max + 1)] | |
for c in callsTimes: | |
calls[c[start]] += 1 | |
calls[c[end]] -= 1 | |
count = 0 | |
max_count = 0 | |
for c in calls: | |
count += c | |
if count > max_count: | |
max_count = count | |
return max_count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment