I am unable to solve this problem, please give me some hint.
Having problem in solving char change problem
Take a window which contains at max K b characters, so that they can be turned into a, try this for whole string to get maximum length of substring of a and repeat the same for b.