This is a dynamic programming paradigm, how?
dynamic programming == Careful bruteforces
in dynamic programming whenever we solve a problem we just stores its solution somewhere so that later we can use this solution to avoid recomputing that is what we are calling here Careful bruteforce meaning we are solving each and every subproblems but not doing recomputing.
we are bruteforcly solving for longest monotonicaly increasing sequence for every $i$ ( $0 <= i < n-2$ )
eg. $A = [1, 2, 3, 4, 4, 1, 4, 5]$
the longest monotonicaly increasing sequence is $[1, 2, 3, 4]$
when $i = 0$
so for $i = 0$ we have calculated & stored 3 subproblems $L[0], L[1]$ and $L[2]$ now for $i = 1, 2$ we don't need to recalculate it. we can start from $i = 3$.
conclusion: we are calculating for each $i$(bruteforce) but stroing its value(careful) so we do not rneed to ecompute later thus it is following the dynamic programmming paradigm.