`#include
#include
int suffixCount(std::string S, int L) {
// Your code here
std::string suff = "";
int count;
//identify full suffix
for(int i = S.length()-L; i<S.length(); i++){
suff.push_back(S.at(L));
}
//find suffix in string
if(suff.length() == 1){
for(int i=0; i < S.length(); i++){
if(suff.at(0) == S.at(i)){
count += 1;
}
}
}
else if(suff.length()==0){
return 0;
}
else{
int subCount = 0;
for(int i=0; i<S.length(); i++){
for(int j=0; j<suff.length(); j++){
if(suff.at(j) == S.at(i)){
subCount += 1;
}
if(subCount == suff.length()){
count += 1;
}
}
}
}
//std::cout << suff << std::endl; //testing
return count;
}
`
`#include
#include
int suffixCount(std::string S, int L) {
// Your code here
std::string suff = "";
int count;
}
`