Even expected and custom test case output are matching , at submission it is showing wrong result by the same program. How is it possible?
I have the same problem !!
does not understand the reason
Check your code at boundary conditions. Also when checking occurrence, keep an eye on the pointer, that may go beyond the array.