**Problem** : https://www.codechef.com/problems/YVSTR

Can someone please help me find where is my

```
[1] failing.
What I did was, firstly find the maximum contiguous subsequence of a particular character (stored in the vector cnt) (of course this subsequence is a substring), for ex. $"aabaabbb"$ has $cnt[a]$ = 2 and $cnt[b]$ = 3. These groups of substrings contribute a total of $\sum_{i=1}^{26} cnt[i]$ to the final result. Now, I partitioned the given string into groups such that each group contains only 2 different characters (these partitions, too are substrings as the groups considered are formed by contiguous indices of the string), and hashed the pair of frequencies of both the characters, then looked for the max frequency of the 1st character and corresponding max frequency of the 2nd and similarly for the 2nd character, taking care of subtracting the overlapping case.
Can someone please let me know if my logic is flawed or the implementation or there are some corner case I am missing. I've considered a lot of examples but no luck, only WA :(.
[1]: https://www.codechef.com/viewsolution/22073116
```