
You are given an integer array nums .
You want to maximize the alternating sum of nums , which is defined as the value obtained by adding elements at even indices and subtracting elements at odd indices. That is, nums[0] - nums[1] + nums[2] - nums[3]...
You are also given a 2D integer array swaps where swaps[i] = [p _i , q _i ] . For each pair [p _i , q _i ] in swaps , you are allowed to swap the elements at indices p _i and q _i . These swaps can be performed any number of times and in any order.
Return the maximum possible alternating sum of nums .
2 <= nums.length <= 10 ^51 <= nums[i] <= 10 ^90 <= swaps.length <= 10 ^5swaps[i] = [p _i , q _i ]0 <= p _i < q _i <= nums.length - 1[p _i , q _i ] != [p _j , q _j ]