fork download
  1. #include <iostream>
  2. using namespace std;
  3. // palindrone problems
  4. class Solution {
  5. public:
  6. bool isPalindrome(string s) {
  7. int n=s.size();
  8. // Run the loop for the given problems
  9. for(int i=0;i<n;i++){
  10. if(s[i]!=s[n-i+1]){
  11. return "false";
  12. }
  13.  
  14. }
  15.  
  16. return "true";
  17. }
  18.  
  19.  
  20. };
  21.  
  22.  
  23. int main() {
  24. // your code goes here
  25. Solution s1;
  26. bool palindronexp=s1.isPalindrome("Suman");
  27.  
  28.  
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
Standard output is empty