values sorted in non-decreasing order and a number min_len. Distribute all of the elements among one or more chains so that:
- every element lands in exactly one chain (elements keep their array order inside a chain);
- the values inside each chain are strictly increasing;
- every chain holds at least min_len elements.
Return True if such a split exists and False otherwise.values=[2, 3, 3, 5, 5, 8], min_len=3 → True
There are two 3s, so at least two chains are needed; with 6 values both can reach length 3: [2, 3, 5] and [3, 5, 8].
values=[4, 4, 4, 6, 7], min_len=2 → False
The three 4s must go to three different chains, each needing at least 2 values: that is 6 values, but there are only 5.
values=[1, 9], min_len=1 → True
values is sorted in non-decreasing ordervalues=[2, 3, 3, 5, 5, 8], min_len=3
True
Run checks the first 3 tests in your browser. Submit checks all 106 tests on the server, hidden ones included.