Question Link - https://workat.tech/problem-solving/practice/palindrome
My code- https://ide.codingblocks.com/s/655159
This is my code the default output is true but the answer is not passing the test cases… if maybe someone can help with the code…
Palindrome qyestion
corrected code -->
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
while(n>0){
string s1;
cin>>s1;
string s2 = s1;
reverse(s2.begin(), s2.end());
if(s1==s2){
cout<<"True"<<endl;
} else {
cout<<"False"<<endl;
}
n--;
}
return 0;
}
You are always here for the help thanks vaibhav
1 Like