Implement a function can_split_into_two_gcd_groups(n: int, arr: List[int]) -> Tuple[str, List[int]] that determines if an array of integers can be split into two non-empty groups such that the greatest common divisor (GCD) of each group is equal to 1. If such a split is possible, return "YES" and the group assignments as a list where each element indicates which group (1 or 2) the corresponding element in arr belongs to. If not possible, return "NO" and an empty list.
Input Requirements
n: an integer (1 ≤ n ≤ 20) representing the number of elements in the array.
arr: a list of n integers (1 ≤ arr[i] ≤ 10^6), representing the elements of the array.
Output Requirements
The function should return:
A tuple where the first element is a string "YES" or "NO".
The second element is a list of integers (1 or 2) indicating the assigned group for each element in arr. If the answer is "NO", return an empty list as the second element.
Example
Input
python
n = 5
arr = [2, 3, 4, 5, 6]
Output
python
("YES", [1, 1, 2, 1, 2])
Implementation Requirements
The solution must be contained within a file called /app/solution.py.
Ensure that the implementation is efficient and adheres to the provided constraints.
Notes
Use the greatest common divisor (GCD) to determine the GCD of array segments.
Consider edge cases where it's not possible to split the array into two valid groups.