What would be the solution for the problem? (Practice problem of Two Pointers and Sliding Window)

Flipping subarray:-

You are given a binary array arr whose elements are only
0 and 1
.Your task is to find the length of the longest subarray that contains only
1s after flipping exactly one contiguous subarray from 0 to 1