Interview Questions/Coding/Strict Increase Run Audit

Strict Increase Run Audit

Preview mode. Log in to edit, run, submit, and save progress.

Easy

Strict Increase Run Audit

A quality signal is excellent while every next reading is strictly greater than the previous reading. For each signal log, find the longest excellent run that uses consecutive readings from the original order. Input Format: The first line contains t, the number of test cases. Each test case contains n followed by n readings. Output Format: For each test case, print the length of the longest strictly increasing contiguous run.

Examples

Example 1
Input:
1
6
1 2 2 3 4 1
Output:
3

Explanation: The longest strictly increasing run is 2, 3, 4, with length 3.

Approach hint

Start with a simple approach, explain the trade-off, then move toward a cleaner or more scalable solution.

Common mistake

Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.

Loading...
Input
1 6 1 2 2 3 4 1
Output
3