Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. vector<string> PalindromFilter ( vector<string> words, int minLength )
  7. {
  8. string w ;
  9. vector<string> otv;
  10. for ( auto i=0 ;i < words.size();i++ )
  11. {
  12. w=words.at(i);
  13. int len = w.length();
  14. if (len>=minLength)
  15. {
  16. if (w == string(w.rbegin(), w.rend())) {otv.push_back(w); }
  17. }
  18. }
  19. return otv;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement