Given an array A, find the length of the longest strictly increasing subsequence (LIS).
A subsequence is a sequence that can be derived from an array by deleting some or no elements such that the order of the remaining elements remain the same.
A: [10, 20, 2, 5, 3, 8, 8, 25, 6]
Result: 4
Explanation: Longest increasing subsequence: [2, 5, 8, 25]
The first line contains an integer âTâ denoting the number of test cases.
For each test case, the input has two lines:
For each test case, the output contains a line with one integer denoting the length of the longest increasing subsequence.
5
9
10 20 2 5 3 8 8 25 6
7
10 -63 7 -50 32 -9 -3
7
71 0 4 42 -31 4 -42
6
77 0 -2 25 1 70
7
2 2 1 5 7 -50 80
4
4
3
3
4
1 <= T <= 10
1 <= n <= 3000
-109 <= Ai <= 109