#include<iostream>
#include <string>
bool solution(std::string const &str, std::string const &ending)
{
std::size_t index = str.find(ending);
//std::cout<<"index: "<<index<<std::endl;
if ( index != std::string::npos && (index == (str.size() - ending.size() )))
{
return true;
}
else
{
return false;
}
}
int main()
{
std::string u="He has to give me a new name";
std::string y="name";
std::cout<<std::boolalpha<<solution(u,y);
return 0;
}