Given an integer array nums and an integer k, modify the array by selecting an index i and replacing nums[i] with -nums[i] exactly k times. You may select the same index i multiple times.
Return the maximum possible sum of the array after applying k modifications.
Constraints:
nums.length
nums[i]
k
Given an integer array nums and an integer k, modify the array by selecting an index i and replacing nums[i] with -nums[i] exactly k times. You may select the same index i multiple times.
Return the maximum possible sum of the array after applying k modifications.
Constraints:
nums.length
nums[i]
k