Core logic is working

//$testString = "ABAB"; //ABAB = 2 *this program is producing the
correct output for this string
//$testString = "AAAB"; //AAAB = 1 *this program is producing the
correct output for this string
//$testString = "QUESTION"; //QUESTION = 24572 *this program is
producing the correct output for this string
//$testString = "BOOKKEEPER"; //BOOKKEEPER = 10743 *this program is
producing the correct output for this string

$testString = "NONINTUITIVENESS"; //NONINTUITIVENESS = 8222334634, * it
works yay!

//$testString = "ACCCBCB"; // = 14, working correctly