Leetcode Subarray From A Binary Switch Operation