Help needed to solve the question

have no idea how to approach this question?

@toshitvarshney11 Think dp on this problem. Since the hashes are only upto 26 at any position you have to only consider current and current+ 1 position. If the current is greater than 2 then no need to consider further position else take it into account and add the count. If you want to have more hints on this problem. You can also try ABCDEF in spoj. It might help you too.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.