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?
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?