educative.io

Educative

Explain the "two" in Bottom-up | Longest Alternating subsequence

Hi,

In Bottom-up approach, in the longest alternating subsequence DP problem, why is it mentioned: “where last two elements in ascending/descending order”. I mean why two only?
should not it be only one which is the previous element?