Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- vector<string> PalindromFilter ( vector<string> words, int minLength )
- {
- string w ;
- vector<string> otv;
- for ( auto i=0 ;i < words.size();i++ )
- {
- w=words.at(i);
- int len = w.length();
- if (len>=minLength)
- {
- if (w == string(w.rbegin(), w.rend())) {otv.push_back(w); }
- }
- }
- return otv;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement