Fliping k bits

please make a recursive sollution for this problem .I googled but found only iterative sollution .I tried it myself also for a recursive sollution but did not get sucess .I want recursive sollution because the itertive sollutions present on internet is only according to the question but I want a generalised sollution .For example the problem could have also asked for flippind any two bit or in general fliping any k bits instead of 1 i.e I need a recursive sollution

Problem:

Flip Bit to Win: You have an integer and you can flip exactly one bit from a 0 to a 1, Write code to
find the length of the longest sequence of Is you could create.
Input: 1775 (or : 11011101111)
Output: 8