Help me with solving this problem of InterviewBit

Hey everyone, need your tips/hint to solve the below problem.

Length of Longest Subsequence

Original problem link - Link - https://www.interviewbit.com/problems/length-of-longest-subsequence/

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



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

Longest subsequence is [1 2 10 4 2 1]

Return value 6
Last edited on
how did you get 1 2 10 from 1 11 2 10 ?
I guess by this definition, [1, 2] is a subsequence of [1, 11, 2, 10, 4, 5, 2, 1].
Last edited on
Topic archived. No new replies allowed.