Kindly check my code
@Manvik-Arya-4391661007540658
please add these checks too in while loop if(right<strlen(in) )
Also write these 2 line outside while loop
int currlen = right - left ;
ans = max(ans, currlen);
here is the updated code : https://ide.codingblocks.com/s/292513