Code is giving a wrong output

Hello Grahil, there are two issues in your code first of all you need to start your jth and kth loop from 1 not from 0.

          for(int j=0;j<=n;j++){
              
              for(int k=0;k<=o;k++){

Here both of them will start from 1.
And second issue is that you can’t do the comparison like this x[i-1]==y[j-1]==z[k-1] it is not allowed.
You need to do comparison like x[i-1]==y[j-1] && y[j-1]==z[k-1]
Make these changes and it will be accepted.
I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks :slight_smile:
Happy Coding !!

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.