Question: A concave subsequence is a subsequence where the first and last elements are greater than all other elements in between. For example, [ 1 0
A concave subsequence is a subsequence where the first and last elements are greater than all other elements in between. For example,
is concave, while
is not since the third element is greater than the first element.
Given an array that contains a permutation of n integers, arr
n
determine length of the longest concave subsequence.
A permutation is a sequence of integers from
to n that contains each number exactly once. For example
is a permutation while
and
are not.
A subsequence is derived from a sequence by deleting zero or more elements without changing the order of the remaining elements. For example
is a subsequence of
but
is not.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
