Shouldn’t the return value be 9?
Start from 0, the first time p is 6, the second time is 8; a.indexof('p',2), means starting from index 2, ignoring the ' before 2 p'
Start from 0, the first time p is 6, the second time is 8; a.indexof('p',2), means starting from index 2, ignoring the ' before 2 p'