GETTING WA in ABCstrings

http://www.codechef.com/viewsolution/3645055
this code gives me wrong answer… kindly help :slight_smile:

@akki16 : For the string “ABCABC” your output is 4 , the correct answer is 5 .

Valid substrings are : ABC , BCA , CAB , ABC , ABCABC

1 Like

Here is a test case where your code fail … “ABCC”

//