Please tell why my code is not giving the correct solution


it is showing segmentation fault

Hey @harryson
There is no base case in yuour function fun

Also pass the vectors by reference otherwise for each recurrence call it will first copy vector .

Now try to debug urself