Longest Bitonic Subsequence

easy
1.Given an array of positive integers.
 2.Your task is to print the maximum length of Bitonic subsequence. 
 3.Any subsequenceof array is called Bitonic if it is first increasing, then decreasing.
 4.You have to complete the function printLBS() which should print an Integer

Input Format

1.First line contains an Integer 'N' denoting the size of the array. 2.Second line contains 'N' space separated elements of the array.

Output Format

Print the length of the longest bitonic Subsequence.

Constraints

1<=N<=100
 1<=Ai<=200

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
5
1 2 5 3 2
Output
5
Previous
Optimal Strategy For A Game
Next
Count Palindromic Subsequences

Related Questions