MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / palindrome

Function palindrome

CPP/char array/string.cpp:3–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include<bits/stdc++.h>
2using namespace std;
3string palindrome(string s){
4
5 for (int i = 0; i <s.size()/2; ++i)
6 {
7 if(s[i]!=s[s.size()-i-1]){
8 return "no";
9
10 }
11
12 }
13 return "yes";
14}
15int main(){
16 /*string s;
17 s="siddhu";

Callers 1

mainFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected