Help me in solving SUBCOUNT problem

My issue

can anyone explain the problem with solution

Problem Link: Count Substrings Practice Coding Problem - CodeChef