A-D | Educational Codeforces Round 163 Solutions | Tandem Repeats? | Arrow Path Array Fix | Abhinav

preview_player
Показать описание
Subscribe to the channel for Amazing Coding and Competitive Programming Content.

👉🏻 Coding Profiles

👉🏻 Connect with Me

coding
programming
competitive programming
software developer
software engineer
interview preparation
interview experience
dsa
Educational Codeforces Round 163
Educational Codeforces Round 163 Solutions
Tandem Repeats?
Tandem Repeats? solutions
Tandem Repeats? codeforces
Tandem Repeats? codeforces solutions
Arrow Path
Arrow Path solutions
Arrow Path codeforces
Arrow Path codeforces solutions
Array Fix
Array Fix codeforces
Array Fix solutions
Array Fix codeforces solutions
Special Characters
Special Characters codeforces
Special Characters solutions
Special Characters codeforces solutions

00:00 Introduction
01:55 A. Special Characters
08:00 B. Array Fix
17:30 C. Arrow Path
35:37 D. Tandem Repeats?
Рекомендации по теме
Комментарии
Автор

Problem C explanation was really good. Thanks a lot.

nandanbhowmick
Автор

Thanks bhaiya i like your 3rd question concept most of the people use dfs of this question

codecreateriitp
Автор

I was able to do A, B, C in 58mins. Thanks sir

AbjSir
Автор

if i reach specialist...i will only come to salute you man..! glad i found you...regular viewer
...let see

aankie
Автор

For problem C we can simply check one condition that if if we have '<' at odd column position on 0 based indexing at first row and have '<' at it adjacent column in the second row then it always give "NO" otherwise "YES"

Code in C++:
#include <bits/stdc++.h>

using namespace std;
#define ll long long

int main() {
// Write C++ code here
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
vector<string> v(2);
string s1;
cin>>s1;
string s2;
cin>>s2;
v[0]=s1;
v[1]=s2;
bool flag=true;
for(int j=0;j<n;j++){
if(v[0][j]=='<' && j%2!=0){
if((j-1>0 && v[1][j-1]=='<') || (j+1<n && v[1][j+1]=='<')){
flag=false;
break;
}
}
}
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}

}

Voldemort-mx
Автор

in that robot question it might also happen that ki, the robot is present above (2, n) and then it takes its own step to go down and reach the final cell, how did we conclude that the last step would be by cell>?

Beingamanforever
Автор

for C, can't we just do this, so we first check the initial 0 and n-1 index conditions, keep a variable cnt=0, and then iterate from the 1st and 2nd column and further like this pairwise, (1, 2 -> 3, 4 -> ... x, x+1 .. -> n-2, n-1), , and check if the odd index of first row is <, if so, we cnt++, then we check if the even index of second row is <, if so, we again cnt++, now if(cnt>1), we know that there is no path to pass through those indexes, and pn return

Nishkarsh-gcyr
Автор

C. ques [ > > < ][ > < < ] robot move (1, 1) -> (1, 2) -> (1, 3) -> (2, 3) finally reached but at (2, 2) is '<' ?
doubt for this test case

sangamverma
Автор

ha ha at 27:31 i realized how easy the problem is and tricky

itsmepratham
Автор

Nice Explanation ..I was only able to solve A, B 🥲

priyanshuhbtu
Автор

in problem c, robot could have reached 0, n-1 by arrow(>) of 0, n-2 and from 0, n-1 it may reach to 1, n-1 by it's own step(move 1) isn't this a possibility

jagan
Автор

sir you can use x=1-x; instead of x=(x+1)%2; I always use x=1-x; it's easier to write

AbjSir
Автор

Sir in problem C

If test case is like this

>><
><<

Then according to you answer mst be NO
but sir according to my code answer mst be YES...
And mine Code is also ACCEPTED

prime_great
Автор

thank you for Your Editorials ❤❤
and can you share how to make template like yours

gourabsarkar
Автор

sir give proper roadmap ... i am solve olny a pial5566 this in my codeforce id

pialhasan
Автор

i get the idea of D but not C 😢😢😢😢😢😢😢😢😢😢😢😢😢😢

nikhilsihare
Автор

I don't know why this brute force solution works in problem D.
// !! om namah bhagwate vasudevay !!
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;cin>>s;
int n=s.length();
int n1=n;
if(n%2==1){
n1=n-1;
}
int ans=0;
for(int i=2;i<=n1;i=i+2){
for(int j=0;j<n-i+1;j++){
int flag=0;
for(int k=j;k<j+i/2;k++){
if(s[k]!='?' && s[k+i/2]!='?' && s[k]!=s[k+i/2]){
flag=1;
break;
}
}
if(flag==0){
ans=max(ans, i);
break;
}
}
}
cout<<ans<<endl;
}
}

relaxingnaturalvibrations
Автор

Mee seeing the video without solving even one question🥹

santoshvocals