The problem is PALINT.
Here is my unaccepted answer: WA
Here is accepted answer Right Answer
The only difference in both is the way, i am taking the variable max. In right answer i took max, and first set it’s value to the maximum frequency in the subarray. while in wrong answer i took max=0 and set it’s value only when i am checking for maximum frequency after XOR operation.
My doubt is , in RA i will be only skipping to the good part i.e. more than the greatest frequency that has already occurred, while in WA I will be checking for all the value, so shouldn’t the value of max will be automatically set to the maximum.
What is wrong in the way I’m taking variable max in WA?
Thank you!!