I was given following question on hackerank to solve.
logs[][] have 3 major entries.
1 k
2 k
3 0
K is the number of requests. so when 1 K comes that many requests are served by pod, if 2 K comes then we add K requests to all active pods. if 3 0 comes then it pod with the least serving request is removed.
Return array of failure pods requests
Example - [[1 15],[2 21], [1 30] [3 0] [3 0] ]
output shout be [30,36]
my 6 test cased passed out of 15. Used min-heap but looks like I messed up with implementation.
Comments (3)


