- Видео 221
- Просмотров 27 938
CodeNow - By Gopal Gupta
Добавлен 8 июн 2020
Glad to see you on my channel. Here you will find coding-related content.
Thank you.
Thank you.
Find the Number of Possible Ways for an Event | Simple Maths| Briefly Explained | C++ | Biweekly 141
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks.
Problem Link:- leetcode.com/problems/find-the-number-of-possible-ways-for-an-event/
Submission Link:- leetcode.com/submissions/detail/1420088206/
Leetcode Profile:- leetcode.com/u/gupta_gopal/
Twitter:- gopal_gupta_
LinkedIn 75 Days Challenge:- www.linkedin.com/feed/update/urn:li:activity:7215094952416985088/
Problem Link:- leetcode.com/problems/find-the-number-of-possible-ways-for-an-event/
Submission Link:- leetcode.com/submissions/detail/1420088206/
Leetcode Profile:- leetcode.com/u/gupta_gopal/
Twitter:- gopal_gupta_
LinkedIn 75 Days Challenge:- www.linkedin.com/feed/update/urn:li:activity:7215094952416985088/
Просмотров: 155
Видео
3288. Length of the Longest Increasing Path | Step By Step Solution | Briefly Explained With Example
Просмотров 306Месяц назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- leetcode.com/problems/length-of-the-longest-increasing-path/ Submission Link:- leetcode.com/submissions/detail/1390007184/ Leetcode Profile:- leetcode.com/u/gupta_gopal/ Twitter:- gopal_gupt...
Time Taken to Mark All Nodes | Hindi | Rerooting DP | Briefly Explained | C++ | Biweekly 136
Просмотров 3042 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- leetcode.com/problems/time-taken-to-mark-all-nodes/description/ Submission Link:- leetcode.com/problems/time-taken-to-mark-all-nodes/submissions/1343204031/ Leetcode Profile:- leetcode.com/u/gupta_gopal...
Time Taken to Mark All Nodes | Rerooting DP | Explained With Examples | C++ | Leetcode Biweekly 136
Просмотров 5222 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- leetcode.com/problems/time-taken-to-mark-all-nodes/description/ Submission Link:- leetcode.com/problems/time-taken-to-mark-all-nodes/submissions/1343204031/ Leetcode Profile:- leetcode.com/u/gupta_gopal...
DP Solution | Minimum Number of Flips to Make Binary Grid Palindromic II | With Examples
Просмотров 1,1 тыс.2 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-ii/ Submission Link:- leetcode.com/contest/biweekly-contest-136/submissions/detail/1343142718/ Leetcode Profile:- leetcode.c...
The Celebrity Problem | Greedy | Simple Solution| O(N*N)| GFG | POTD 03-08-24
Просмотров 222 месяца назад
Here I am explaining to you all the solution to this GFG problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- www.geeksforgeeks.org/problems/the-celebrity-problem/1 Leetcode Profile:- leetcode.com/u/gupta_gopal/ Twitter:- gopal_gupta_ LinkedIn 75 Days Challenge:- www.linkedin.com/feed/update/urn:li:activ...
2976.Minimum Cost to Convert String I | Graph |Day22: Final 75- 1000 Days Streak Challenge| Leetcode
Просмотров 282 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem Link:- leetcode.com/problems/minimum-cost-to-convert-string-i/ Submission Link:- leetcode.com/submissions/detail/1335093429/ Leetcode Profile:- leetcode.com/u/gupta_gopal/ Twitter:- gopal_gupta_ Li...
Easiest Solution by AIR-11| Minimum Array Changes to Make Differences Equal| Explained with Example
Просмотров 1,6 тыс.3 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. LinkedIn AIR-11 Post:- www.linkedin.com/feed/update/urn:li:activity:7220468917322887168/ Problem Link:- leetcode.com/problems/minimum-array-changes-to-make-differences-equal/submissions/ Submission Link:-leetcode.com/...
3209. Number of Subarrays With AND Value of K | Binary Search | Day1: Final75 Challenge | Leetcode
Просмотров 413 месяца назад
Here I am explaining to you all the solution to this Leetcode problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks.
Vertical Width of a Binary Tree | With 2 Variables | Simple DFS Solution| O(N)| GFG | POTD 05-07-24
Просмотров 273 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- www.geeksforgeeks.org/problems/vertical-width-of-a-binary-tree/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
Delete node in Doubly Linked List| With Visualization | O(x) | C++ | GFG | POTD 30-06-24
Просмотров 313 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- www.geeksforgeeks.org/problems/delete-node-in-doubly-linked-list/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
The Palindrome Pattern | Simple "For" Loop Solution| O(N^2) | C++ | GFG | POTD 26-06-24
Просмотров 543 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- www.geeksforgeeks.org/problems/the-palindrome-pattern3900/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
Summed Matrix | 1 Line solution with Proof | O(1) | C++ | GFG | POTD 24-06-24
Просмотров 854 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- www.geeksforgeeks.org/problems/summed-matrix5834/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
Construct list using given q XOR queries | Simple Solution | O(Q) | C++ | GFG | POTD 02-06-24
Просмотров 414 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- www.geeksforgeeks.org/problems/construct-list-using-given-q-xor-queries/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
Geek and its Game of Coins | Simple Traversal Solution | O(N) | C++ | GFG | POTD 29-05-24
Просмотров 3454 месяца назад
Here I am explaining to you all the solution to this GFG Daily problem. Here in my channel, I will upload many others coding problem solutions as well. So please Subscribe. Thanks. Problem link:- geeksforgeeks.org/problems/geek-and-its-game-of-coins4043/1 Twitter Profile:- gopal_gupta_ Leetcode Profile:- leetcode.com/gupta_gopal/
Longest subsequence-1 | Simple Traversal Solution | O(N) | C++ | GFG | POTD 27-05-24
Просмотров 284 месяца назад
Longest subsequence-1 | Simple Traversal Solution | O(N) | C | GFG | POTD 27-05-24
Minimum Cost To Make Two Strings Identical | LCS Solution | O(N*M) | C++ | GFG | POTD 26-05-24
Просмотров 164 месяца назад
Minimum Cost To Make Two Strings Identical | LCS Solution | O(N*M) | C | GFG | POTD 26-05-24
Diagonal sum in binary tree | Easiest Solution | O(N) Time Complexity | C++ | GFG | POTD 22-03-24
Просмотров 107 месяцев назад
Diagonal sum in binary tree | Easiest Solution | O(N) Time Complexity | C | GFG | POTD 22-03-24
Possible Paths in a Tree | Easiest DSU Solution | O(Q*N) Time Complexity | C++ | GFG | POTD 21-03-23
Просмотров 127 месяцев назад
Possible Paths in a Tree | Easiest DSU Solution | O(Q*N) Time Complexity | C | GFG | POTD 21-03-23
1835. Find XOR Sum of All Pairs Bitwise AND | Simple Bit Logic| Leetcode| Explained with Example|C++
Просмотров 137 месяцев назад
1835. Find XOR Sum of All Pairs Bitwise AND | Simple Bit Logic| Leetcode| Explained with Example|C
Water the plants | Easiest Solution | O(N) Time Complexity | C++ | GFG | POTD 18-01-23
Просмотров 99 месяцев назад
Water the plants | Easiest Solution | O(N) Time Complexity | C | GFG | POTD 18-01-23
Array Pair Sum Divisibility Problem | O(N) Time Complexity | C++ | GFG | POTD 01-01-23
Просмотров 59 месяцев назад
Array Pair Sum Divisibility Problem | O(N) Time Complexity | C | GFG | POTD 01-01-23
String's Count | O(1) Time Complexity | C++ | GFG | POTD 16-12-23
Просмотров 2010 месяцев назад
String's Count | O(1) Time Complexity | C | GFG | POTD 16-12-23
Shortest path from 1 to n | O(LogN) | C++ | GFG | POTD 30-11-23
Просмотров 3710 месяцев назад
Shortest path from 1 to n | O(LogN) | C | GFG | POTD 30-11-23
Reverse alternate nodes in Link List | Interview Approach | O(N) Time | Without Extra Memory|C++|GFG
Просмотров 67Год назад
Reverse alternate nodes in Link List | Interview Approach | O(N) Time | Without Extra Memory|C |GFG
Distinct Difference | O(NLogN) | C++ | GFG | POTD 19-03-23
Просмотров 15Год назад
Distinct Difference | O(NLogN) | C | GFG | POTD 19-03-23
Minimum Days | O(N) | C++ | GFG | POTD 11-02-23
Просмотров 18Год назад
Minimum Days | O(N) | C | GFG | POTD 11-02-23
Distinct Coloring | DP | C++ | GFG | POTD 01-02-23
Просмотров 33Год назад
Distinct Coloring | DP | C | GFG | POTD 01-02-23
Min operations | Bit Manipulation | C++ | GFG | POTD 29-01-22
Просмотров 32Год назад
Min operations | Bit Manipulation | C | GFG | POTD 29-01-22
Geeks And The String | Stack | O(N) Time | C++ | GFG | POTD 23-01-22
Просмотров 18Год назад
Geeks And The String | Stack | O(N) Time | C | GFG | POTD 23-01-22
op bro. great !!
thanks👍
Great explanation man. Kudos for the solution. Keep helping others.🎉
Glad you liked it 😀
Nice explanation sir , according to you what should be the rating of this problem ?
This should be under Hard tag on Leetcode.
Good approach Gopal !! Keep posting the contest solution . The part i liked most is how you described the intutuion , most people describe solution but very few describe its intution I am subscribing you .
Glad you liked it😀.
This explanation might not be entirely clear, so I have created a detailed tutorial in Hindi for better understanding. You can check it out here:- ruclips.net/video/6-52VV1doOc/видео.html
No way this could be considered a medium problem hahaha. Thanks for sharing the solution to this problem!
Glad you like it 😄.
bhaiya can you please try to write the logic more cleaner? like you can use write-pad-pen rather then mouse. and if possible it will be better if you explain in hindi bcz i face some difficulty. and will definately help your channel grow. otherwise all good.
I use english to improve my communication skills, ig I used only normal english but will try one in hindi as well, for now I will write approach as a text as well for better understanding as I don't have writepad :'
best explanation on utube!!
Thanks
Love your channel! Keep growing. I am stuck on 1650 Rating, how to improve? (leetcode)
haha my rating is exactly 1650.
@@satvikpandey700 SAME!!!
You should focus on B/C problem difficulty level and try to upsolve atleast Till C of other contest, u will reach knight
Thank you, simple and clean code 🖌️
NICE SUPER EXCELLENT MOTIVATED
NICE SUPER EXCELLENT MOTIVATED
Thank you for this explanation sir : )
Great Work!
nice explanation
thnx bro \
Now this question has some extra test cases added, this program will fail when n and d both have value 1 and also you have not considered gcd ,it should be in the simplest form ,at last a and b should be divided by its gcd to get the simplest fraction.
my side
prog.cpp: In member function void Solution::dfs(Node*, int&, int&): prog.cpp:106:71: error: _gcd was not declared in this scope if(r->left && r->right) cur_gcd=_gcd(r->left->data,r->right->data); this compiler error
if(r->left && r->right) cur_gcd=_gcd(r->left->data,r->right->data); this is error line no 106 how to resolve
Use double _ before gcd, you are using just single _ , so getting error.
Gcd was not delecared
looking for code help could you share email id
code is shown in the video already.
You are great bro 👍👍👍
Thanks.
perfect explanation
d is the frequency of each element in the entire array?
D is count of different no. In my current subaaray from start to end
Thanks bro , I was stuck in this problem and your soln really helped me ......
Best Solution!
Coding ninjas is better for data structures course sir
Thankyou
thank you for the video
Nice explanation bhaiya
Please help this code sir
?
Sir please share ur mail id i will share program pic i need program for that
Swap parity, good array programs solution want sir please share
Please provide link as I didn't find any such problem.
Please solve this code sir I need it
i watched this solution by many channel but i did not get but here i understood thanks bro!
Great explanation
Good Logic!!
I just saw this Channel. The Explanation was Awesome! Keep Growing !!!!
Thanks!
Good night bro 😊
U2 bro😊
How your solution is O(N)? I think, it is O(NlogN) because you are creating a set of N elements for finding distinct integers. Please clarify.
Ohh yeah! For 'Set' it's O(NlogN). And if we take unordered_set then it reduces to O(N). Thanks for reminding.
Hey bro 😎 can u please create a playlist of python 🐍
I will try to create it in future because as of now I don't have advanced knowledge of Python.
@@codenow6386 oh thanx man I appreciate your work and will be waiting for the python 🐍 series .
sir ,what if v[ ] = {2, 4,5} and X = 6 . then we wouldn't have got our answer .
What is the value of s?
sir , i get it now
@@akshaynegi4707 ya same doubt what did you get??
thank for making tutorial it helps me a lot.
Glad, this helps you.
Sir can you explain in python too
Bro I don't have good command on python.
Hey it was a nice explanatory video Could you help me out with this coding solution it is currently giving WA ----------------------------------------------------------------------------------------------- vector<vector<int>> direction={{1,0},{0,1},{-1,0},{0,-1}}; int longestIncreasingPath(vector<vector<int>>& matrix) { // Code here if( matrix.size()==0) return 0; int n=matrix.size(),m=matrix[0].size(),longestPath=0; vector<vector<int>> cache(n,vector<int> (m,0)); for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { int longest=recursiveFunction(matrix,cache,i,j); longestPath=max(longest,longestPath); } } return longestPath; } int recursiveFunction(vector<vector<int>>& matrix,vector<vector<int>>& cache, int i,int j) { if(cache[i][j]>0) return cache[i][j]; int n=matrix.size(),m=matrix[0].size(),size=0; for(int k=0;k<direction.size();k++) { int x=i+direction[k][0],y=j+direction[k][1]; if(x>-1&&y>-1&&x<n&&y<m&&matrix[i][j]<matrix[x][y]) { int longest=recursiveFunction(matrix,cache,x,y); size=max(size,longest); } } cache[i][j]=size+1; return cache[i][i]; }
very complicated solution. It is just an easy problem. just sort an array and if prev and current have the same parent then find the gcd of their child and get maximum. @CODEnow please check others solutions and explain so other students can quickly get them. This is just advice if you can please don't take it personally.
Bro same thing that you are saying , I did code and explain. Code may vary but approach is same as yours.
Please write in clear handwriting
Take care of it from next time.
But O(nlogn was expected) not to just pass all the given test cases
Yeah, I know that but this Time Complexity is possible with a segment tree that has a very complex code and my only point to make this video is to make the approach as easy as possible.
👍