Condition to check if the character is not present in the String B
if ( pos == 0 && next [ A [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] [ pos ] == inf ) { numberOfSubsequences = - 1 ; break ; }