First, let's review some definitions. Feel free to skip this part if you are familiar with them.
A sequence

is an increasing (decreasing) subsequence of a sequence

if

can be obtained from

by deletion of several (possibly, zero or all) elements and all elements are in increasing (decreasing) order from the beginning to the end.
A permutation is an array consisting of

distinct integers from

to

in arbitrary order. For example,

is a permutation, but

is not a permutation (

appears twice in the array) and

is also not a permutation (

but there is

in the array).
The problem starts from here. Link has an array. He is currently learning the longest increasing subsequence algorithm. So he comes up with the following question.
Let the value of a permutation

be
%2C%7B%5Crm%20lds%7D(p)))
, where
)
is the length of the longest increasing subsequence of

and
)
is the length of the longest decreasing subsequence of

. For all permutations of length

, which one has the minimum value?