Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool is_palindrome(vector < char >& s){
- int l = 0, r = s.size() - 1;
- while(l < r)
- if(s[l++] != s[r--]) return false;
- return true;
- }
- void print(){
- cout << (is_palindrome(s) ? "true" : "false");
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement