TLE in merge sort (recursion exercise)

code: https://ide.codingblocks.com/s/77067
my code is giving TLE. How to optimize it

hey siddharth, please make following changes to avoid TLE

  • in line 26, i will start from s instead of 0
  • in line 37 make it mergesort(a,s,mid) instead of mergesort(a,0,mid)