RRiseLattice
Workflows

Coding workflows · Strictly increasing subsequence length

03
Built around your work

A concrete starting point

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.

01

Open the context

Choose the project folder and name the files or behavior involved.

02

Define the change

Describe the input, expected output and boundaries that must stay intact.

03

Inspect the work

Review the proposed edits and any commands before relying on their result.

04

Check the outcome

Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

Strictly increasing subsequence length

A concrete starting point
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.

AI coding workspace

Your next change starts here.

Get the Windows app ↗