Open the context
Choose the project folder and name the files or behavior involved.
Find the length of a strictly increasing subsequence in at most 1000 integers. Test duplicates, descending data and empty input, rejecting non-integers while preserving the original order and values.
Choose the project folder and name the files or behavior involved.
Describe the input, expected output and boundaries that must stay intact.
Review the proposed edits and any commands before relying on their result.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
from bisect import bisect_left
def increasing_length(values):
values = tuple(values)
if len(values) > 1000 or any(type(v) is not int for v in values):
raise ValueError("values.integer")
tails = []
for value in values:
position = bisect_left(tails, value)
if position == len(tails):
tails.append(value)
else:
tails[position] = value
return len(tails)The example is a starting point for a real project, not a claim that generated code is already tested. Adjust paths, dependencies and expected behavior to match your application.