You are given an integer array nums.
An array is called parity alternating if every pair of adjacent elements has different parities (that is, no two adjacent elements are both even or both odd).
In one operation, you can choose any index i and either increase or decrease nums[i] by
Return an array ans of length
ans[0] is the minimum number of operations needed to make nums parity alternating.
ans[1] is the minimum possible value of numsnums
Constraints:
nums.length
nums[i]
You are given an integer array nums.
An array is called parity alternating if every pair of adjacent elements has different parities (that is, no two adjacent elements are both even or both odd).
In one operation, you can choose any index i and either increase or decrease nums[i] by
Return an array ans of length
ans[0] is the minimum number of operations needed to make nums parity alternating.
ans[1] is the minimum possible value of numsnums
Constraints:
nums.length
nums[i]