I think it's pretty obvious your old solution resets the index at the first match and begins counting from 0 from after it (since the second o is index 2 with respect to the letter after the first o, if it were considered index 0). Can't confirm because it seems you've changed the answer eventually. Please try to be more helpful with your questions next time and specify your language, etc.
I think it's pretty obvious your old solution resets the index at the first match and begins counting from 0 from after it (since the second
o
is index 2 with respect to the letter after the firsto
, if it were considered index 0). Can't confirm because it seems you've changed the answer eventually. Please try to be more helpful with your questions next time and specify your language, etc.Incorrect answer for str="Hello world!!!" symbol=o
Expected: equal to 7
Actual: 2
??? wt?