Company: Cisco_21_jan
Difficulty: medium
Longest Increasing Subsequence Problem Description You are given an array of integers in random order. Your task is to find the length of the longest subsequence in the array such that the elements of the subsequence are in strictly ascending order. A subsequence is derived by deleting some or no elements of the array without changing the order of the remaining elements. For example, given the array [10, 22, 9, 33, 21, 50, 41, 60, 80] , the subsequences [10, 22, 33, 50, 60, 80] and [10, 21, 50, 60] are valid ascending subsequences, but [10, 33, 22] is not because it is not in ascending order. Input An array of integers arr in random order. Output Return the length of the longest subsequence of numbers in ascending order. Examples Example 1: Input: arr = [10, 9, 2, 5, 3, 7, 101, 18] Output: 4 Explanation: The longest ascending subsequence is [2, 3, 7, 101], which has a length of 4. Example 2: Input: arr = [0, 1, 0, 3, 2, 3] Output: 4 Explanation: The longest ascending subsequence is [0,