Challenge Information

Title : longest increasing subsequence
Difficulty : Expert
Solutions : 4
Maximum Score : 500
Completed by You: No
Description :

Given an array of numbers, find the length of the longest increasing subsequence in the array. The subsequence does not necessarily have to be contiguous.

Write a function solve that have the following parameter(s):
1.) arr = an array

Example
Input:
[0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15]
Output:
6

Explanation
An array [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15] will return the longest increasing subsequence length 6 it is (0, 2, 6, 9, 11, 15).

Example
Input:
[2, 8, 4, 5, 32, 10, 6, 14, 1, 9, 12, 13, 3, 11, 7, 15]
Output:
8

Explanation
An array [2, 8, 4, 5, 32, 10, 6, 14, 1, 9, 12, 13, 3, 11, 7, 15] will return the longest increasing subsequence length 8 it is (2, 4, 5, 6, 9, 12, 13, 15).

Constraints

Judocode