contiguous subarray. A swap operation allows exchanging any two indices. If the array contains no 1s, the function should return -1. - Count the total number of 1s in the array. - If `totalOnes` is 0, ...