the case where L = U . This case is trivially solvable in O(n) time using a sliding window of the appropriate length. More generally, when L 6= U , this yields a trivial O(n(U L+1)) algorithm. Huang =-=[Hua94-=-] studied the case where U = n, i.e., there is eectively no upper bound on the width of the desired maximum-density segments. He observed that an optimal segment exists with width at most 2L 1.