Length of Longest Subsequence

Problem Setter: mayank111
Problem Tester: glowing_glare

Given an array of integers, find the length of longest subsequence which is first increasing then decreasing.

**Example: **

For the given array [1 11 2 10 4 5 2 1]

Longest subsequence is [1 2 10 4 2 1]

Return value 6

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Length of Longest Subsequence on Interview Code Editor
Sign Up
to access hints and editorial solutions for Length of Longest Subsequence
Asked In:
  • Microsoft

Discussion


Loading...
Click here to start solving coding interview questions