You are given a binary array nums.
A subarray is considered alternating if no two adjacent elements within the subarray have the same value.
Return the total number of alternating subarrays in nums.
Constraints:
nums.length
nums[i] is either
You are given a binary array nums.
A subarray is considered alternating if no two adjacent elements within the subarray have the same value.
Return the total number of alternating subarrays in nums.
Constraints:
nums.length
nums[i] is either