Recursion call related problem

when i change the j value in line 17 and 18. one case i got all substring and in second case i got null. why??

second photo i am attaching in another doubt.(only one photo can attach)

hello @officialharshit1996

if u call seq( i,j) first then u will get null because seq(i,j) will put null as jth position when it hit base case and ur updation that u have done in line 16 will lost.

try to add cout statements before and after function call and in base case for better clarity