Alpha Score (Divide & Conquer)

I’m solving Alpha score problem using merge sort similar to what we do in inversion count. But don’t know why I’m getting my answer always as zero, I tried to debug my code for possible errors but couldn’t find any.

Hi @Shivansh-Srivastava-2813454628880698
I can see you have used mid=(low+high) in line number 9 and missed a division by 2. So you are always getting output 0 because of invalid/wrong comparisions.

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.