Condition to check if reached at the end of B or no such element exists on or next to A [ pos ] , thus increment number by one and reinitialise pos to zero
else { numberOfSubsequences ++ ; pos = 0 ; } } return numberOfSubsequences ; }