Skip to content

Instantly share code, notes, and snippets.

@hansrajdas
Last active December 12, 2018 10:49
Show Gist options
  • Save hansrajdas/6b8a5d29329aa75409560df612c085a8 to your computer and use it in GitHub Desktop.
Save hansrajdas/6b8a5d29329aa75409560df612c085a8 to your computer and use it in GitHub Desktop.
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