- 2 118
- 2 743 888
GeeksforGeeks Practice
India
Приєднався 23 лют 2021
Still scared of Programming Problems? Here, we will help you with step by step implementation of
algorithms with visualization of code.
algorithms with visualization of code.
POTD - 13/09/2024 | Mirror Tree | Problem of the Day | GeeksforGeeks Practice
Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills.
So come along and solve the GFG POTD of 13th Sep 2024 with us!
💻 Try it Yourself: practice.geeksforgeeks.org/problems/mirror-tree/1?
Find daily solutions for POTD here on our channel! Make sure you are subscribed and stay updated.
-----------------------------------------------------------------------------------------
🏆 Take part in our Weekly Coding Contests: practice.geeksforgeeks.org/events/rec/gfg-weekly-coding-contest?
📖 Master Competitive Programming - Complete Beginner to Advanced: practice.geeksforgeeks.org/courses/competitive-programming-cp?
-----------------------------------------------------------------------------------------
Follow us and stay updated on everything happening in the world of geeks:
📱 Twitter- geeksforgeeks
📝 LinkedIn- www.linkedin.com/company/geeksforgeeks
🌐 Facebook- geeksforgeeks.org
📷 Instagram- geeks_for_geeks?hl=en
#GFGPractice #GeeksforGeeks #ProblemofTheDay #CodingQuestions #POTD #POTD13Sep #problemsolving #practice #dsa #MirrorTree #tree #dynamicprogramming #datastructures #alogrithim #yashdwivedi #gfgpractice
So come along and solve the GFG POTD of 13th Sep 2024 with us!
💻 Try it Yourself: practice.geeksforgeeks.org/problems/mirror-tree/1?
Find daily solutions for POTD here on our channel! Make sure you are subscribed and stay updated.
-----------------------------------------------------------------------------------------
🏆 Take part in our Weekly Coding Contests: practice.geeksforgeeks.org/events/rec/gfg-weekly-coding-contest?
📖 Master Competitive Programming - Complete Beginner to Advanced: practice.geeksforgeeks.org/courses/competitive-programming-cp?
-----------------------------------------------------------------------------------------
Follow us and stay updated on everything happening in the world of geeks:
📱 Twitter- geeksforgeeks
📝 LinkedIn- www.linkedin.com/company/geeksforgeeks
🌐 Facebook- geeksforgeeks.org
📷 Instagram- geeks_for_geeks?hl=en
#GFGPractice #GeeksforGeeks #ProblemofTheDay #CodingQuestions #POTD #POTD13Sep #problemsolving #practice #dsa #MirrorTree #tree #dynamicprogramming #datastructures #alogrithim #yashdwivedi #gfgpractice
Переглядів: 8
Відео
POTD - 12/09/2024 | Middle of a Linked List | Problem of the Day | GeeksforGeeks Practice
Переглядів 1772 години тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Geetesh Yadav. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 11th Sep 2024 with us! 💻 Try it Yoursel...
POTD - 11/09/2024 | Minimum Cost of Ropes | Problem of the Day | GeeksforGeeks Practice
Переглядів 2014 години тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 11th Sep 2024 with us! 💻 Try it Yourself...
POTD - 10/09/2024 | Circle of Strings | Problem of the Day | GeeksforGeeks Practice
Переглядів 4077 годин тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 08 Sep 2024 with us! 💻 Try it Yourself: ...
POTD- 08/09/2024 | Minimum Number of Jumps | Problem of the Day| GeeksforGeeks Practice
Переглядів 28312 годин тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Karan. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 08 Sep 2024 with us! 💻 Try it Yourself: www.gee...
GFG Weekly Coding Contest - 171 Post Analysis | GeeksforGeeks Practice
Переглядів 1,1 тис.12 годин тому
Join us for a post-contest analysis with Ayush Tripathi where we will discuss the problems from the GFG Weekly Coding Contest - 171. In this session, Nitin will share his approach to solving problems and provide valuable insights on approaching similar problems in the future. Whether you participated in the contest or not, this session is a great opportunity to learn new problem-solving techniq...
POTD- 07/09/2024 | Nth Natural Number | GeeksforGeeks Practice
Переглядів 40114 годин тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Devashish Khare. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 07th Sep 2024 with us! 💻 Try it Yours...
POTD- 06/09/2024 | Kadane's Algorithm | Problem of the Day | GeeksforGeeks Practice
Переглядів 24216 годин тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Devashish Khare. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 06th Sep 2024 with us! 💻 Try it Yours...
POTD- 05/09/2024 | Missing in Array | Problem of the Day| GeeksforGeeks Practice
Переглядів 24219 годин тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 05 Sep 2024 with us! 💻 Try it Yourself:p...
POTD- 04/09/2024 |Count ways to N'th Stair(Order does not matter) |Problem of the Day |GeeksforGeeks
Переглядів 28621 годину тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kalpas. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 4th Sep 2024 with us! 💻 Try it Yourself:...
POTD- 03/09/2024 | Minimum number of deletions and insertions. | Problem of the Day | GeeksforGeeks
Переглядів 179День тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kalpas. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 3rd Sep 2024 with us! 💻 Try it Yourself:...
POTD- 02/09/2024 | Max Sum Path In Two Arrays | Problem of the Day | GeeksforGeeks
Переглядів 239День тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kalpas. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 2nd Sep 2024 with us! 💻 Try it Yourself:...
POTD- 31/08/2024 | Sorted subsequence of size 3 | Problem of the Day | GeeksforGeeks
Переглядів 165День тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kalpas. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 31st Aug 2024 with us! 💻 Try it Yourself...
POTD- 30/08/2024 | N-Queen Problem | Problem of the Day | GeeksforGeeks Practice
Переглядів 165День тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Devashish Khare. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 30th Aug 2024 with us! 💻 Try it Yours...
POTD- 01/09/2024 | Max Sum Path In Two Arrays | Problem of the Day | GeeksforGeeks
Переглядів 354День тому
Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kalpas. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Data Structures and Algorithms but will also help you build up problem-solving skills. So come along and solve the GFG POTD of 1st Sep 2024 with us! 💻 Try it Yourself:...
GFG Weekly Coding Contest - 170 Post Analysis | GeeksforGeeks Practice
Переглядів 1,3 тис.День тому
GFG Weekly Coding Contest - 170 Post Analysis | GeeksforGeeks Practice
POTD- 29/08/2024 | Find length of Loop | Problem of the Day | GeeksforGeeks
Переглядів 28114 днів тому
POTD- 29/08/2024 | Find length of Loop | Problem of the Day | GeeksforGeeks
POTD- 28/08/2024 | Sorting Elements of an Array by Frequency | Problem of the Day | GeeksforGeeks
Переглядів 49214 днів тому
POTD- 28/08/2024 | Sorting Elements of an Array by Frequency | Problem of the Day | GeeksforGeeks
POTD- 27/08/2024 | Maximum Difference | Problem of the Day | GeeksforGeeks
Переглядів 29514 днів тому
POTD- 27/08/2024 | Maximum Difference | Problem of the Day | GeeksforGeeks
POTD- 26/08/2024 | Wildcard Pattern Matching | Problem of the Day | GeeksforGeeks
Переглядів 23014 днів тому
POTD- 26/08/2024 | Wildcard Pattern Matching | Problem of the Day | GeeksforGeeks
POTD- 25/08/2024 | Number of pairs | Problem of the Day| GeeksForGeeks Practice
Переглядів 49214 днів тому
POTD- 25/08/2024 | Number of pairs | Problem of the Day| GeeksForGeeks Practice
POTD- 24/08/2024 | 0 - 1 Knapsack Problem | Problem of the Day| GeeksForGeeks Practice
Переглядів 26214 днів тому
POTD- 24/08/2024 | 0 - 1 Knapsack Problem | Problem of the Day| GeeksForGeeks Practice
POTD- 23/08/2024 | Left View of Binary | Tree Problem of the Day| GeeksForGeeks Practice
Переглядів 14421 день тому
POTD- 23/08/2024 | Left View of Binary | Tree Problem of the Day| GeeksForGeeks Practice
Job-A-Thon 36 Hiring Challenge Post Contest Analysis || Gaurav Patel || GeeksforGeeks Practice
Переглядів 34021 день тому
Job-A-Thon 36 Hiring Challenge Post Contest Analysis || Gaurav Patel || GeeksforGeeks Practice
POTD- 22/08/2024 | Alien Dictionary | Problem of the Day| GeeksForGeeks Practice
Переглядів 26521 день тому
POTD- 22/08/2024 | Alien Dictionary | Problem of the Day| GeeksForGeeks Practice
POTD- 21/08/2024 | Shortest path in Undirected Graph | Problem of the Day| GeeksForGeeks | Practice
Переглядів 17521 день тому
POTD- 21/08/2024 | Shortest path in Undirected Graph | Problem of the Day| GeeksForGeeks | Practice
POTD- 20/08/2024 | Burning Tree | Problem of the Day| GeeksForGeeks | Practice
Переглядів 25221 день тому
POTD- 20/08/2024 | Burning Tree | Problem of the Day| GeeksForGeeks | Practice
POTD- 19/08/2024 | Kth Smallest | Problem of the Day| GFG Practice
Переглядів 25721 день тому
POTD- 19/08/2024 | Kth Smallest | Problem of the Day| GFG Practice
POTD- 18/08/2024 | Split an array into two equal Sum subarrays | Problem of the Day| GFG Practice
Переглядів 36421 день тому
POTD- 18/08/2024 | Split an array into two equal Sum subarrays | Problem of the Day| GFG Practice
GFG Weekly Coding Contest - 168 Post Analysis | GeeksforGeeks Practice
Переглядів 1,1 тис.21 день тому
GFG Weekly Coding Contest - 168 Post Analysis | GeeksforGeeks Practice
Good job sir
Harris Kenneth Thomas Angela Taylor Sharon
Worst explanation ever
Well explained
thanks glad that it helped
Sir I am bengali medium student...Which language would be better to prepare for TCS, bengali&english?please tell me
Video title is wrong for this video.
Please Bring back Yash Dwivedi sir or Sid Sir :)
worst
good explanation!
Thank you very much! It was extremely helpful in understanding the paths in the grid problem.
NYC explaination 👍
Is there more optimized approach for the same or any algorithm to reduce LOC
The explanation is ok but I love those videos in which the approach is explained in the way that iit is live video. This video seems to be more scripted then an explanation.
Good Explanation!!! class Solution { public: Node *reverse_linked_list(Node *head) { Node *curr = head; Node *prev = NULL; Node *next = NULL; while (curr != NULL) { next = curr->next; curr->next = prev; prev = curr; curr = next; } return prev; } Node *merge2Sortedlist(Node *ptr1, Node *ptr2) { Node *Dummy_node = new Node(-1); Node *temp = Dummy_node; Node *t1 = ptr1; Node *t2 = ptr2; while (t1 != NULL && t2 != NULL) { if (t1->data <= t2->data) { temp->next = t1; temp = t1; t1 = t1->next; } else { temp->next = t2; temp = t2; t2 = t2->next; } } // Checking if the t1 is still present or not while (t1 != NULL) { temp->next = t1; temp = t1; t1 = t1->next; } // Checking if the t2 is still present or not while (t2 != NULL) { temp->next = t2; temp = t2; t2 = t2->next; } return Dummy_node->next; } Node *sort(Node *head) { // Splitting the linked list into 2 parts Node *first = new Node(-1); Node *second = new Node(-1); Node *t1 = first; Node *t2 = second; Node *curr = head; while (curr != NULL) { t1->next = curr; t1 = t1->next; curr = curr->next; if (curr != NULL) { t2->next = curr; t2 = t2->next; curr = curr->next; } } t1->next = NULL; t2->next = NULL; Node *ptr1 = first->next; Node *ptr2 = second->next; // after the spliting part just reverse the 2nd linked list ptr2 = reverse_linked_list(ptr2); // Now there is a ptr1 pointing to 1 linked list and a ptr2 pointing to the other linked list head = merge2Sortedlist(ptr1, ptr2); return head; } };
I have a coupon for a course worth INR 1500. If I purchase a course using this coupon, will the 90% refund offer still apply? Can I get 90% of my fees back after completing the course within 90 days?
very poor explanation
worst explanation
The explanation is not that good.If necessary make the video long but don't compromise on explanation.
didn't understand a thing you were saying. please give clear explanations
explained very well 😊!!
🎉😊
for question 2nd simple approach would be to sort arr1 in ascending order and arr2 in descending order and then apply simple 2 pointers. code will be like this: long long fndMax(int n, int m, vector<int>& arr1, vector<int>& arr2) { sort(arr1.begin(),arr1.end()); sort(arr2.begin(),arr2.end(),greater<int>()); int i=0,j=n-1; int k=0,l=m-1; long long ans=0; while(i<=j&&k<=l){ if(abs(arr1[i]-arr2[k])>=abs(arr1[j]-arr2[l])){ ans+=abs(arr1[i]-arr2[k]); i++; k++; } else{ ans+=abs(arr1[j]-arr2[l]); j--; l--; } } return ans; }
thanks
This weekly contest was tough
Worst explanation 👎👎
Good explanation👌
3/10 for explanation
bro you can speak in hindi if you want
Then how non hindi person like me can understand
Will this code(after base change) work for any other digit?? for example - "after removing all numbers with digit 3".
i want to know this too
Nice Logic 👍
Best explanation ever
the time complexity for the brute force is O(nlogn) right, if we use digit extraction for finding if 9 is present in the number or not?
Johnson Brian Thomas Charles Wilson Patricia
first question: c=0 while n: if n%2==0: break c+=1 n=n>>1 c=2**c return c
digit dp
Good approach we can also calculate sum of first n natural number n*(n+1)/2 and substract accumulate(are.begin(),are.end(),0) from it
agree
Nyc
public class String_Question2 { public static int atoi(String str) { int result = 0; int i = 0; int sign = 1; if (str.charAt(i) == '-') { sign = -1; i++; } while (i < str.length()) { if (str.charAt(i) < '0' || str.charAt(i) > '9') { return -1; } result = result * 10 + str.charAt(i) - '0'; i++; } return result * sign; } public static void main(String[] args) { String str = "123"; int integerValue = atoi(str); System.out.println("Integer value: " + integerValue); } } // Another method // public class String_Question2 { // public static void main(String[] args) { // String str = "1234"; // int num = Integer.parseInt(str); // System.out.println(num); // } // }
Or simply return (n/2)+1 as for every n we can represent it in multiple to 2 like for n = 1 (1+0*2), n=2 (1+1+0*2 or 0+1*2) etc
kya ghatiya explaination tha yr,..........aisa lag raha bas bhaga rahe hai, samjhane ka man hi nahi kar raha, ......pata nahi jab nahi man karta to kyu video dalte hai faaltu fokat me,..........
not even explained how (b^-1)%mod = b^(mod-2), the main thing,...........then why you are teaching can I ask you @Yash Dwivedi,...If you have some shame remaining, then please don't do this type of mistake again..
Why the hell gfg is recruiting such fellows 💀💀💀💀💀💀
Love this mentor ..... amazing explanations (specially last problem) Thankyou GFG 🙂
Nice explanation. Cheers.
Kindly discuss Time & complexity as well.
great explanation!!
He is a little bit dumb. He just reads things and tells them to the audience.I do not understand the question solution.Please back Yash Dwivedi, sir.
Why can't we use dfs + dp? It is giving wrong result
if we use dp, we will be prematurely assigning values to dp. if dp[row][col] is set to some cell, you can never go through that cell again. the problem comes because of the 4 directions instead of 2 but if we observe carefuly the min cost path is made up of only down and right directions. never left and up. even if we can travel 4 directions, it is suffice to travel only 2 because everything is a positive integer
class Solution { public: vector<int> start, end; void Euler_tour(int ×, vector<int> adj[], int node, int par) { start[node] = times++; for (auto it : adj[node]) { if (it != par) { Euler_tour(times, adj, it, node); } } end[node] = times - 1; } vector<vector<int>> twoMax(int n, int m, int rootServer, vector<vector<int>> &edges, vector<int> &requests) { start.resize(n + 1, 0); end.resize(n + 1, 0); vector<int> adj[n + 1]; for (auto it : edges) { adj[it[0]].push_back(it[1]); adj[it[1]].push_back(it[0]); // Assuming undirected graph } int times = 1; Euler_tour(times, adj, rootServer, -1); vector<int> temp(n + 1, 0); for (int i = 1; i <= n; i++) { temp[start[i]] = i; } vector<pair<int, int>> prefix(n + 1, {INT_MIN, INT_MIN}); vector<pair<int, int>> suffix(n + 1, {INT_MIN, INT_MIN}); int maxi1 = INT_MIN; int maxi2 = INT_MIN; for (int i = 1; i <= n; i++) { if (temp[i] > maxi1) { maxi2 = maxi1; maxi1 = temp[i]; } else if (temp[i] > maxi2) { maxi2 = temp[i]; } prefix[i] = {maxi1, maxi2}; } maxi1 = INT_MIN; maxi2 = INT_MIN; for (int i = n; i >= 1; i--) { if (temp[i] > maxi1) { maxi2 = maxi1; maxi1 = temp[i]; } else if (temp[i] > maxi2) { maxi2 = temp[i]; } suffix[i] = {maxi1, maxi2}; } vector<vector<int>> result; for (int i = 0; i < m; i++) { int node = requests[i]; int start_time = start[node]; int end_time = end[node]; int res_maxi1 = INT_MIN; int res_maxi2 = INT_MIN; if (start_time > 1) { res_maxi1 = prefix[start_time - 1].first; res_maxi2 = prefix[start_time - 1].second; } if (end_time < n) { res_maxi1 = max(res_maxi1, suffix[end_time + 1].first); res_maxi2 = max(res_maxi2, suffix[end_time + 1].second); } result.push_back({res_maxi1, res_maxi2}); } return result; } }; where i made the mistake plz help me guys
Thank you for amazing content ❤❤❤❤🎉🎉😊😊😊
In the second the problem why we are dividing the total number with 3 ,is there any specific intuation behind that?
@@arijitdas4560 bro we want to make sure we get the elder = 2 * younger so to find the share of younger we divide by 3
@@ayaaniqbal3531 yeah got the idea , Thanks a lot
Total sweetness is constant. Let's suppose total. According to the given problem bob's candy should be 2X of John's sweetness. So we can say bob's sweetness= 2* John's sweetness.-------------(1) As the total sweetness is constant so we can say : John's sweetness+ Bob's sweetness= total sweetness ----(2) If we put equations 1's value in equation 2 then we got John's sweetness=total sweetness/3. I hope this explanation helps you.
@@alokbhowmik3547clear explanation. Thank you.
@@codeofcoffee8722 ❤️