Codechef Starters 140 | Video Solutions - A to E | by Ankit Ghildiyal | TLE Eliminators

  Рет қаралды 3,647

TLE Eliminators - by Priyansh

TLE Eliminators - by Priyansh

Күн бұрын

Here are the video solutions in the form of a post-contest discussion for problems A, B, C, D, E of Codechef Starters 140 (Div 2). The live discussion was done with students of TLE Eliminators, this is the recording of the same. We hope this will be useful for you in up-solving this contest.
📢Check out handpicked problems by Priyansh himself, on our CP-31 sheet: www.tle-eliminators.com/cp-sheet
Solution Codes:
Problem A: pastebin.com/MDr6a4Qt
Problem B: pastebin.com/qGGBPu0H
Problem C: pastebin.com/wyM10aFe
Problem D: pastebin.com/HpnBHL8x
Problem E: pastebin.com/i2s8uK7r
Be sure to check out TLE Eliminators.
Website: www.tle-eliminators.com/
Instagram: / tle_eliminators
Linkedin: / tle-eliminators
Twitter: / tle_eliminators
TLE Community Discord Server: / discord
Timestamps:-
0:00 Problem A
5:10 Problem B
11:35 Problem C
20:29 Problem D
29:06 Problem E

Пікірлер: 27
@josuke21
@josuke21 29 күн бұрын
Your explanation is poor . Atleast dry run the code.
@sujansinhthakor2314
@sujansinhthakor2314 29 күн бұрын
for problem c, if you just try to come up with answer of n = 4,5,6,7 then you eventually you will get the pattern.
@TLE_Eliminators
@TLE_Eliminators Ай бұрын
Please fill the feedback form: forms.gle/3zBtR5zkbaVrxKzh7
@shubhamjha2486
@shubhamjha2486 29 күн бұрын
Just great explanations. Big fan 🙏. Also , can you please tell me how to be so good at proving your solutions I mean you're just great !
@VaibhavSingh-rf2ud
@VaibhavSingh-rf2ud 29 күн бұрын
what about problem f?
@dhruv6102
@dhruv6102 26 күн бұрын
came for question B. Sorry sir but not able to understand !
@ankitshiksharthi3141
@ankitshiksharthi3141 Ай бұрын
Thumbnail??
@nityas8049
@nityas8049 29 күн бұрын
In problem D how does it make sure that it will print odd degree nodes only? If anyone knows please explain..
@hashirshaikh510
@hashirshaikh510 28 күн бұрын
In a tree, if you check, all leaf nodes have a degree = 1 So you can remove all leaf nodes first, and once you remove them, their parents will become the leaf node of the new tree formed due to their removal. And so on, you can just go on removing the leaf nodes until only root node is left So you can always remove n-1 nodes... basically just go on removing leaf nodes, then next set of leaf nodes...so on uptil only root node is left He is doing a dfs, where he is passing the vertex and its parent. When the dfs function is returning from its function call, it means the node now has no more children, and he is making a check that vertex != Parent ,which means its a leaf node, and hence you can just print it In this way you will print all leaf nodes in order uptil only the root node is left
@nityas8049
@nityas8049 28 күн бұрын
@@hashirshaikh510 Thank you so much for your explanation
@captvashu8142
@captvashu8142 29 күн бұрын
where to learn z algo or other string alfgoS>?
@Abc-lr4bf
@Abc-lr4bf 29 күн бұрын
cp algorithm
@kumkumslab5811
@kumkumslab5811 29 күн бұрын
no need i think sliding window lagao ho jaega
@captvashu8142
@captvashu8142 28 күн бұрын
@@kumkumslab5811 but for similar questions it is must \
@crazytourist6619
@crazytourist6619 29 күн бұрын
Can anyone help me with TREE REMOVAL problem ? I did the same approach and implemented but code gives WA on hidden testcase, I'm unable to debug.. If anyone can help me find the testcase on which it is failing.. MY CODE : #include using namespace std; #define int long long int #define endl " " #define all(v) (v).begin(), (v).end() #define vi vector void dfs(map &mp, int node, int parent, vector &vec) { for (auto ele : mp[node]) { if (ele != parent) { dfs(mp, ele, node, vec); } } vec.push_back(node); } void solve() { int n; cin >> n; vector v; for (int i = 0; i < n; i++) { int x; cin >> x; v.emplace_back(x); } map mp; for (int i = 0; i < n - 1; ++i) { int u, v; cin >> u >> v; mp[u].push_back(v); mp[v].push_back(u); } int node = *(min_element(all(v))); cout
@_dragneel_
@_dragneel_ 29 күн бұрын
I think you are considering the min value as root but not the node with min value. For example, values are [6,7,8,5] then in your case root is 5 but it should be 4 (1-based indexing)
@crazytourist6619
@crazytourist6619 29 күн бұрын
@@_dragneel_ Oh yes that was the problem. I confused indices and values. Thank you so much for pointing it out. 🙏🏼🫂
@nishanttyagi3665
@nishanttyagi3665 29 күн бұрын
can someone please help me with this for fifth question giving run time error #include using namespace std; int main() { int t; cin>>t; while(t--){ string s; cin>>s; int ans=0; int n=s.length(); if(n%2!=0) ans=0; else{ int x=n/2; vectorprefix(n),suffix(n),mera(n); for(int i=0;i=0) prefix[i]=prefix[i-1]+s[i]; else prefix[i]=s[0]; } for(int i=n-1;i>=0;i--){ if(i
@_ayush_NIT_Allahabad
@_ayush_NIT_Allahabad 29 күн бұрын
bakwas explaination, na sound hai, na dry run. should give more time on explanation and intution than just showing the code
@kumkumslab5811
@kumkumslab5811 Ай бұрын
d wala aache se clear nhi hua
@alankritsingh5222
@alankritsingh5222 29 күн бұрын
jiski value minimum ho usko root assume kro aur kisi bhi tree me root hi hogi jo kabhi bhi ans me add nhi hogi(kyuki end me uski degree 0)hogi aur leaf ki degree 1 h to bottom to up move kro aur value ko score me add kro aur leaf ko store kr dena
@kumkumslab5811
@kumkumslab5811 29 күн бұрын
@@alankritsingh5222 ohk got it thanks
@iitianshah_1502
@iitianshah_1502 29 күн бұрын
yaar es bhaiya ka itna ganda explanation h , raghav bhiaya is fine
@ITACHIUCHIHA-dr8sz
@ITACHIUCHIHA-dr8sz 29 күн бұрын
idk man, i find his explanations good enough
@TheBaljitSingh
@TheBaljitSingh 29 күн бұрын
explanation can be better
@akshit6653
@akshit6653 28 күн бұрын
Extremely poor explanation
@ankitris5201
@ankitris5201 16 күн бұрын
poor explanation
Codechef Starters 144 | Video Solutions - A to D | by Harsh Gupta | TLE Eliminators
52:13
TLE Eliminators - by Priyansh
Рет қаралды 1,5 М.
Codeforces Round 961 | Video Solutions - A to B2 | by Harsh Gupta | TLE Eliminators
53:42
TLE Eliminators - by Priyansh
Рет қаралды 1,9 М.
Cool Items! New Gadgets, Smart Appliances 🌟 By 123 GO! House
00:18
123 GO! HOUSE
Рет қаралды 17 МЛН
🤔Какой Орган самый длинный ? #shorts
00:42
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 8 МЛН
Leetcode Weekly Contest 404 | Video Solutions - A to D | by Abhinav Kumar | TLE Eliminators
1:49:57
Leetcode Weekly Contest 407 | Video Solutions - A to D | by Viraj Chandra| TLE Eliminators
1:20:50
I PLAYED JULIUS CAESAR
27:38
GothamChess
Рет қаралды 113 М.
The ORDER BY Algorithm Is Harder Than You Think
13:46
Tony Saro
Рет қаралды 59 М.
Codechef Starters 141 | Video Solutions - A to D | by Abhinav Kumar | TLE Eliminators
2:04:51
TLE Eliminators - by Priyansh
Рет қаралды 4,5 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 267 М.
Cool Items! New Gadgets, Smart Appliances 🌟 By 123 GO! House
00:18
123 GO! HOUSE
Рет қаралды 17 МЛН