Company: Mthree _23feb
Difficulty: medium
Max Separations Problem Description You are working in the Data Consistency team of your company. You are allocated a task as follows: You have a data stream arr of N integers that contains an equal number of odd and even numbers. You can make separations in the data stream. A separation is made between two adjacent elements and splits the stream at that point. After all your separations are made, every resulting part must contain an equal number of odd and even elements. (inferred - the source states the rule for "both partitions after separation"; when several separations are made, it is applied to every contiguous part they produce.) Making a separation between two adjacent numbers x and y costs |x - y| coins. The cost of a set of separations is the sum of the costs of its separations, and you may spend at most K coins in total . Find the maximum number of separations you can make. Making no separation at all is always allowed and costs 0 coins. Function Description Complete the fun