Write solution(services, lambdaScaled, observed). Given monitored service names, expected failure rates (scaled ×1,000,000), and observed failure counts, return the services that breach a simple anomaly rule.
lambda[i] = lambdaScaled[i] / 1,000,000. z = average(lambda values across all services) / 3. For each service: threshold = lambda + z * sqrt(lambda). A service breaches if observed > threshold. Return breaching service names sorted by exceed amount (observed − threshold) descending; ties broken alphabetically. Empty array if none breach.
Example
services = ["PRICING", "NEWS", "FEEDS"]
lambdaScaled = [4000000, 9000000, 1000000]
observed = [9, 13, 2]
lambda = [4, 9, 1]; average = 4.6667; z = 1.5556.
Output: ["PRICING"]
LSEG - London Stock Exchange • Pending
LSEG - London Stock Exchange • Pending
LSEG - London Stock Exchange • Pending
LSEG - London Stock Exchange • Pending
LSEG - London Stock Exchange • Pending