http://www.nxcoding.com/archives/leetcode-daily-3067-longest-alternating-group-subsequence-i