public boolean either24(int[] nums) {
        boolean is22 = false;
        boolean is44 = false;
        for (int i = 0; i < nums.length-1; i++) {
            if (nums[i] == 2 && nums[i+1] == 2) {
                is22 = true;
            } else if (nums[i] == 4 && nums[i+1] == 4) {
                is44 = true;
            }
        }
        return (is22 && !is44) || (!is22 && is44);
    }