A - Yes or Yes? (Problem 1703A) - Codeforces Round 806 (Div.4) Problem- https://codeforces.com/contest/1703/problem/A Approach- Since we have to check just three letters, so we can just match them individually. Check whether the first letter is 'Y' or 'y' similarly to 'E' and 'e' and also for 'S' and 's' . It is already given that the length of the string is 3 so we do not have to worry about any further cases. Below is the detailed code in C++ exactly matching the explanation above. Code - string s; cin>>s; if((s[0]=='y'||s[0]=='Y')&&(s[1]=='e'||s[1]=='E')&&(s[2]=='s'||s[2]=='S')) cout<<"YES"<<endl; else cout<<"NO"<<endl; Other Problems from this Contest- https://contestsolver.blogspot.com/2022/07/round806.html Disclaimer- Everything is published after the actual contest gets over.
Codeforces, Codechef, Atcoder, Leetcode Contest Solutions and Code
These solutions are posted after the contest gets over and should be used for educational purposes only. Codeforces Educational, Global, Div2 and Div3 Rounds, Leetcode Weekly and Biweekly Contests, Atcoder Beginner and Regular Contests, and Codechef Lunchtime, Starters, Long Challenge, and Cookoff Editorials are posted regularly.