Codeforces|Leetcode|Codechef free solutions
Open in Telegram
Free codeforces, Codechef, Leetcode solutions are available 😍😍😍😍😍😍 Helped More than 200+ students to crack coding round in 2022 and helped placed them in Good companies. 🥳🥳🥳🤩🤩🤩 Dm @Cpsoln if you want help in coding round.
Show more4 317
Subscribers
No data24 hours
-137 days
-5230 days
Posts Archive
#include<bits/stdc++.h> #define int long long using namespace std; const int N=1000000+10; const int MOD=1e9+7; const int inf=1e18; inline int read(){ int x=0,f=1;char c=getchar(); while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();} while(c>='0'&&c<='9'){x=(x<<1)+(x<<3)+c-'0';c=getchar();} return x*f; } void solve(){ int n; n=read(); string s; cin>>s; int i=0,j=n-1; string rev=s; reverse(rev.begin(),rev.end()); if(s==rev){ printf("Yes\n"); return; } while(i<=j){ if(s[i]==s[j]){ i++,j--; } else{ break; } } while(i<=j){ if(s[i]!=s[j]){ s[i]=s[j]; i++,j--; } else{ break; } } rev=s; reverse(rev.begin(),rev.end()); if(s==rev){ printf("Yes\n"); } else{ printf("No\n"); } } signed main(){ int T; cin>>T; while(T--) solve(); return 0; }
Repost from Codeforces|Leetcode|Codechef free solutions
Contact me before your coding round and book your slot
100% solutions guaranteed 🔥🔥🔥🔥🔥
‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️
Solution for all companies will be available
🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁
Get a special discount
Dm @Cpsoln
‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️
Don't trust on other telegram channels they will take money and block you
Repost from Codeforces|Leetcode|Codechef free solutions
Contact me before your coding round and book your slot
100% solutions guaranteed 🔥🔥🔥🔥🔥
‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️
Solution for all companies will be available
🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁🎁
Get a special discount
Dm @Cpsoln
‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️
Don't trust on other telegram channels they will take money and block you
I will post D when the channel crosses 2250+ subscribers
class Solution {
public:
int minImpossibleOR(vector& nums) {
map mp;
for (auto& x: nums) {
mp[x]++;
}
for (int i = 0; i < 31; i++) {
if (!mp[1 << i]) {
return 1 << i;
}
}
return -1;
}
};
