Last active
December 12, 2018 11:02
-
-
Save HemantNegi/0d80aa7783ca348e45cf1dc42af41f2c to your computer and use it in GitHub Desktop.
Customer service capacity
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
# Note: 1 case fails | |
import math | |
import os | |
import random | |
import re | |
import sys | |
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 - _min + 1)] | |
for c in callsTimes: | |
calls[c[start] - _min] += 1 | |
calls[c[end] - _min] -= 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