Largest index to be reached in Binary Array after K jumps between different values
Given a binary array arr[] of size N and an integer K, the task is to find the highest index which can be reached in exactly K jumps starting from first index, when one jump can be made between indices having different values. Examples: Input: arr[] = {0, 1, 1, 0, 1, 0}, K = 2Output: 5Explanation: A