Finding pairs for the given sum


why i was getting an error

what if t became less than zero if i a codition
t= 3 and a[i]==5 then u get t=-2 and no base case handle this
u will get into infinte recursion