Can anyone explain why my code gives errors on every fking testcase to the SQRDSUB problem from this month’s long challenge?

My Submission

My main solution logic is in `void solve(int tc)`

function

Well, so as an explanation for the code, I am computing using DP the number of substrings (contiguous subsequences) ending at every index and having remainder modulo 4 as 0,1,2 or 3 in the ‘b’ vector.

And at the end, I sum over all such indices and don’t take the substrings having values as 2 mod 4