Complete the function FindLastIndex() that takes one string parameter and one character parameter. The function returns the index of the last character in the string that is not equal to the character parameter. If no such character is found, the function returns -1.
Ex: If the input is tbbdn b, then the output is:
4
#include
using namespace std;
int FindLastIndex(string inputString, char x) {
/* Your code goes here */
}
int main() {
string inString;
char x;
int result;
cin >> inString;
cin >> x;
result = FindLastIndex(inString, x);
cout << result << endl;
return 0;
}