Doubt in merge sort using recursion

Please let me know what’s wrong in my code. Thanks in advance.

Hello @gambhirrahul0 please wait i am checking your code:

Hello @gambhirrahul0 i have corrected your code and now it is passing every test case:
you cant define the size of array larger than 1e6 in your main.
also there is no need of long long int.
these all things optimsie your program.


if you have any doubt you can ask here:
Happy Learning!!

But according to the given constraints, |Ai| <= 10^9. Also, please elaborate what all I did wrong.

Hello @gambhirrahul0 int can handle the value till 1e9 and long long int is required to handle elements upto range of 1e18.
i have mentioned your major mistakesin the above code :
Happy Learning!!

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.