Unable to counter the error

I have written the code according to the logic explained in the video, but still i am getting wrong answer, i tried to print the hashmap , and there were wrong values inserted in the hashmap, but id on’t know why? please if you can check my code
code link :-https://drive.google.com/file/d/1JbxWpADYUflYxndLzIh2n-aam8M2CE4s/view?usp=sharing

@saksham_thukral
broo u are missing the case of t
test cases

No no , this is the code that i have written in codeblocks only,for one case only, i haven’t yet implemented this for t cases, i am saying that its not working for even 1 case properly…

there are garbage value in prefix array

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.