follows

CF

Character B follows A

Given a string S and two characters A, B the program must print the number of occurrences where A is followed by B. Example 1:…