Palindromic substrings

#include <bits/stdc++.h> using namespace std; int main () { int x; cin>>x; for(int i=0;i<x;i++) { string a,b;int ll=0; cin>>a>>b; for(int j=0;j<a.length();j++){ for(int k=0;k<b.length();k++){ if(a[j]==b[k]) { ll=1; break; } } if(ll==1) break; } if(ll==1) cout<<"Yes"<<endl; else cout<<"No"<<endl; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.