Skip to content

Instantly share code, notes, and snippets.

@HemantNegi
Last active December 12, 2018 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HemantNegi/0d80aa7783ca348e45cf1dc42af41f2c to your computer and use it in GitHub Desktop.
Save HemantNegi/0d80aa7783ca348e45cf1dc42af41f2c to your computer and use it in GitHub Desktop.
Customer service capacity
# 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