Alternating Groups Leetcode Problem Solving