← Questions

Longest increasing subarray and subsequence

0
MetaCodingLast asked Jul 2025

Two warm-ups on one array:

  1. The longest strictly increasing contiguous run (for 1, 2, 1, 2, 3 it is 1, 2, 3).
  2. The longest increasing subsequence, whose elements need not be adjacent: first in quadratic time, then in O(n log n) with patience-style binary search.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding