A three element sequence (a1, a2, a3) will be an alternating sequence if its elements hold one of the following conditions:
{a1 > a2 < a3 } or { a1 < a2 > a3}.
Based on the above. I am not able to make sense of the first example
Input: {1,2,3,4}Output: 2Explanation: There are many LAS: {1,2}, {3,4}, {1,3}, {1,4}
Kindly clarify if the above really has an alternating sequence