https://dailyjavaconcept.com/find-longest-alternating-subarray/
Find Longest Alternating Subarray