← ALL NOTES
Array

1606. Find Servers That Handled Most Number of Requests

Request i wants server i % k, and when that one is busy it walks forward — i+1, i+2, past k-1 and around to 0 — until something is free. That walk is the entire problem, and writing it out literally is the trap: a for loop over k slots per request costs 1e10 steps at the upper bound, and it looks ha

Loading…