HELP in REPLESX

This is my Code. It is giving WA but I am not able to figure out why?

if(k == p){ cout<<1<<endl; }
this is not always true
for example consider below tc
4 2 4 4
1 3 4 5
in this p == k
but answer is 3