CT044

Ladder of Increasing Badges

MediumL5 · Recursion RenegadeAcceptance: 0.0%XP: 60

A collector walks through badge ranks and wants the longest subsequence that increases strictly, even when skipping badges. Task: Find the length of the longest strictly increasing subsequence, not necessarily contiguous. Input format: n; then n integers. Output format: Print the LIS length. Constraints: 1 <= n <= 200000; values fit signed 32-bit integers

Example 1:

Input: 8 10 9 2 5 3 7 101 18
Output: 4

Example 2:

Input: 1 5
Output: 1

Example 3:

Input: 5 5 4 3 2 1
Output: 1

Constraints:

1 <= n <= 200000; values fit signed 32-bit integers

Tags:

dynamic-programming binary-search lis
Loading...
Test Cases:No test cases
No test cases available.