Setter: Nisarg Thakkar
Tester: Krunal Mathukiya
Editorialist: Malhar Patel
The idea behind the problem boils down to following : You are given a string and you have to find the minimum distance which you can travel by using the maximum number of a single character.
Let’s say we have a string baaabb, then we can go from 1 to 6 by using three b's or from 2 to 4 by using three a's. And according to the Question, we can say that the latter is the choice we want and so we have explained the logic.
Feel free to Share your approach, if you want to. (even if it’s the same ) . Suggestions are welcomed as always had been.