![masked coder](/img/default-banner.jpg)
- Видео 341
- Просмотров 201 323
masked coder
Добавлен 14 дек 2023
This channel is an effort to reach out and help the students who want to enhance their Computer Science skills in the field.
It contains my CP journey, my DSA Practice, my Projects and the new skills I learn
It contains my CP journey, my DSA Practice, my Projects and the new skills I learn
#242 | Square root of a number | gfg potd | 13-08-2024 | GFG Problem of The Day
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C++ | Square root of a number | Intuition Explained🧠
Problem Statement : www.geeksforgeeks.org/problems/square-root/1
Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/13.08.2024.cpp
----------------------------------------------------------------------------------------------------------
Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri
Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq
----------------------------------------------------------------------------------------------------------
🌐 Connect with Me:
GitHub: github.com/Masked-coder11
Instagram: garg.yugayu?igsh=MWZlcnR2bm90aW85Nw==
Linke...
Problem Statement : www.geeksforgeeks.org/problems/square-root/1
Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/13.08.2024.cpp
----------------------------------------------------------------------------------------------------------
Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri
Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq
----------------------------------------------------------------------------------------------------------
🌐 Connect with Me:
GitHub: github.com/Masked-coder11
Instagram: garg.yugayu?igsh=MWZlcnR2bm90aW85Nw==
Linke...
Просмотров: 271
Видео
#240 | Job Sequencing Problem | gfg potd | 11-08-2024 | GFG Problem of The Day
Просмотров 849День назад
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C | Job Sequencing Problem | Intuition Explained🧠 Problem Statement : www.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1 Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/11.08.2024.cpp Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq 🌐 Conn...
L26. | Check for Children Sum Property | Binary Trees | Live Coding
Просмотров 10День назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: www.geeksforgeeks.org/problems/sum-tree/1 Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/check for children sum property 🌐 Connect with Me: G...
L25. | Maximum Width of Binary Tree | Binary Trees | Live Coding
Просмотров 10День назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: leetcode.com/problems/maximum-width-of-binary-tree/description/ Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/662 🌐 Connect with Me: GitHub:...
L24. | Root to Leaf node paths | Binary Trees | Live Coding
Просмотров 17День назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: leetcode.com/problems/binary-tree-paths/description/ Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/257 🌐 Connect with Me: GitHub: github.com...
#239 | Rotate a Linked List | gfg potd | 10-08-2024 | GFG Problem of The Day
Просмотров 230День назад
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C | Rotate a Linked List | Intuition Explained🧠 Problem Statement : www.geeksforgeeks.org/problems/rotate-a-linked-list/1 Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/10.08.2024.cpp Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq 🌐 Connect with Me: Gi...
L23. | Bottom View of Binary Tree | Binary Trees | Live Coding
Просмотров 6День назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: www.geeksforgeeks.org/problems/bottom-view-of-binary-tree/1 Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/bottom view of a binary tree 🌐 Con...
L22. | Top View of Binary Tree | Binary Trees | Live Coding
Просмотров 5День назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: www.geeksforgeeks.org/problems/top-view-of-binary-tree/1 Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/top view of a binary tree 🌐 Connect w...
L21. | Vertical Order Traversal | Binary Trees | Live Coding
Просмотров 914 дней назад
Hi All ! You can find rest other lectures of Binary Tree in the featured playlist Linked List Series: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree Series: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Problem Link: leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/description/ Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/987 🌐 Connect wit...
Level 2A- Get started with HTML | Full Stack Development Course
Просмотров 1714 дней назад
Hope you are excited to learn If you are keen to learn DSA for Placements Following can be of help to you Codes- github.com/Masked-coder11/full-stack-dev/blob/main/2a Linked List- ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree- ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Stack- ruclips.net/p/PLkWk97X4k6wyMY0WF5las7YLCfrFetjad Leetcode Easy- ruclips.net/p/PLkWk97X4k6wx9tT_IfNO...
#238 | Maximize Array Value After Rearrangement | gfg potd | 09-08-2024 | GFG Problem of The Day
Просмотров 95414 дней назад
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C | Maximize Array Value After Rearrangement | Intuition Explained🧠 Problem Statement : www.geeksforgeeks.org/problems/maximize-arrii-of-an-array0026/1 Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/09.08.2024.cpp Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvb...
Level 1- All About Internet | Full Stack Development Course
Просмотров 3314 дней назад
Hope you are excited to learn If you are keen to learn DSA for Placements Following can be of help to you Linked List- ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree- ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Stack- ruclips.net/p/PLkWk97X4k6wyMY0WF5las7YLCfrFetjad Leetcode Easy- ruclips.net/p/PLkWk97X4k6wx9tT_IfNOrgAMnbBgY_CQp Leetcode Medium- ruclips.net/p/PLkWk97X4k6wzDK2...
#234 | Bottom View of Binary Tree | gfg potd | 05-08-2024 | GFG Problem of The Day
Просмотров 14914 дней назад
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C | Bottom View of Binary Tree | Intuition Explained🧠 Problem Statement : www.geeksforgeeks.org/problems/bottom-view-of-binary-tree/1 Solution Code : github.com/Masked-coder11/gfg-POTD/blob/main/05.08.2024.cpp Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq 🌐 Connect...
L4.| Kth Smallest Element in an Array | Heaps | Live Coding
Просмотров 4014 дней назад
Hi guys Hope you all are excited to learn heaps Problem Link: www.geeksforgeeks.org/problems/kth-smallest-element5635/1 Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/kth smallest element Other resources you might find helpful: Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Stacks: ruclips.net/p/P...
L3.| Kth Largest Element in an Array | Heaps | Live Coding
Просмотров 1614 дней назад
Hi guys Hope you all are excited to learn heaps Problem Link: leetcode.com/problems/kth-largest-element-in-an-array/description/ Solution code: github.com/Masked-coder11/Leetcode-Problems/blob/main/215 Other resources you might find helpful: Linked List: ruclips.net/p/PLkWk97X4k6wwxPtbUZZqVDPYDqW62P2Ri Binary Tree: ruclips.net/p/PLkWk97X4k6wwupiQJ-mvlQTvbHQ17Hdmq Stacks: ruclips.net/p/PLkWk97X4...
L2.| Check if an Array represents a Heap | Heaps | Live Coding
Просмотров 2414 дней назад
L2.| Check if an Array represents a Heap | Heaps | Live Coding
#232 | The Celebrity Problem | gfg potd | 03-08-2024 | GFG Problem of The Day
Просмотров 12114 дней назад
#232 | The Celebrity Problem | gfg potd | 03-08-2024 | GFG Problem of The Day
Chapter 1- RoadMap for Full Stack Development | MERN STACK
Просмотров 3121 день назад
Chapter 1- RoadMap for Full Stack Development | MERN STACK
L1.| Introduction to Heaps and Priority Queues | Heaps
Просмотров 7028 дней назад
L1.| Introduction to Heaps and Priority Queues | Heaps
#224 | K-Pangrams | gfg potd | 26-07-2024 | GFG Problem of The Day
Просмотров 58828 дней назад
#224 | K-Pangrams | gfg potd | 26-07-2024 | GFG Problem of The Day
L20. | K Sum Paths in a binary tree | Binary Trees | Live Coding
Просмотров 1728 дней назад
L20. | K Sum Paths in a binary tree | Binary Trees | Live Coding
L19. | Kth Ancestor in a Tree | Binary Trees | Live Coding
Просмотров 2928 дней назад
L19. | Kth Ancestor in a Tree | Binary Trees | Live Coding
#223 | Array to BST | gfg potd | 25-07-2024 | GFG Problem of The Day
Просмотров 44028 дней назад
#223 | Array to BST | gfg potd | 25-07-2024 | GFG Problem of The Day
#222 | Check for BST | gfg potd | 24-07-2024 | GFG Problem of The Day
Просмотров 18128 дней назад
#222 | Check for BST | gfg potd | 24-07-2024 | GFG Problem of The Day
#221 | Merge two BST 's | gfg potd | 23-07-2024 | GFG Problem of The Day
Просмотров 267Месяц назад
#221 | Merge two BST 's | gfg potd | 23-07-2024 | GFG Problem of The Day
L18. | Lowest Common Ancestor of a Binary Tree | Binary Trees | Live Coding
Просмотров 32Месяц назад
L18. | Lowest Common Ancestor of a Binary Tree | Binary Trees | Live Coding
L17. | Diameter of Binary Tree | Binary Trees
Просмотров 23Месяц назад
L17. | Diameter of Binary Tree | Binary Trees
L16. | Construct Binary Tree from Preorder and Postorder Traversal | Made Easy
Просмотров 12Месяц назад
L16. | Construct Binary Tree from Preorder and Postorder Traversal | Made Easy
L15. | Construct Binary Tree from Inorder and Postorder Traversal | Made Easy
Просмотров 11Месяц назад
L15. | Construct Binary Tree from Inorder and Postorder Traversal | Made Easy
#219 | Maximum product subset of an array | gfg potd | 21-07-2024 | GFG Problem of The Day
Просмотров 290Месяц назад
#219 | Maximum product subset of an array | gfg potd | 21-07-2024 | GFG Problem of The Day
bhaiya please comple heaps playlist as soon as possible ....please please please big bro
On it
Good Job dude. Keep it up
Thanks, will do!
can you made a separate video for this type of competitive programming concept ( like 1LL , 1e9+7 , ......)
Alright will try in near future
pls could u help me in java code .. some test cases are failing ... class Solution { int Maximize(int arr[]) { Arrays.sort(arr); long ans=0; for(int i=0;i<arr.length;i++){ ans+=(long)arr[i]*i; ans%=100000007; } return (int)ans; } }
In mod value ig one zero is less
@@maskedcoder-dy1ub tq so muchhhh .. it was a silly mistakee
i have a doubt why have you used 1LL?
To convert right hand side into long long to avoid overflowing
@@maskedcoder-dy1ub can you made a separate video for this type of competitive programming concept
yeah i also felt that plz make a seprate video.
Great video brother !
Appreciate it!
😊 we are so excited 🥳🥳
love ya ❤❤❤❤❤❤
Woohoo🥳🥳
Nice ❤
My solution is also the same but I used vector instead of unordered_map since the latter can take O(n) time complexity in the worst case scenario
Correct But it was working fine with it😅😅
@@maskedcoder-dy1ub It worked for me as well. Using Unordered_map took 0.09s to run while vector took 0.02s. That's why I shared it😅
Thank you Mask-man, you are back!!
👍👍👍
Thank you bro Helping me out in building consistency
Happy to help
GFG POTD 25/07/2024 Node *buildBSTFromInorder(const vector<int> &inorder, int start, int end) { if (start > end) { return nullptr; } int mid = (start + end) / 2; Node *node = new Node(inorder[mid]); node->left = buildBSTFromInorder(inorder, start, mid - 1); node->right = buildBSTFromInorder(inorder, mid + 1, end); return node; } class Solution { public: Node* sortedArrayToBST(vector<int>& nums) { // Code here Node *root = buildBSTFromInorder(nums, 0, nums.size() - 1); return root; } };
My solution is also same except I declared prev as class attribute and used same function. Code: class Solution { int prev = -1; public: bool isBST(Node* root) { if(!root) return true; bool left = isBST(root->left); if(!left) return false; if(root->data <= prev) return false; prev = root->data; bool right = isBST(root->right); return left && right; } };
Can we do this without taking extra space to store the inorder traversal of root1 and root2?
Tried it Couldn't find a way
@@maskedcoder-dy1ub we can use the concept of merging 2 BST into 1 BST and then finding the inorder. We will first convert both the trees into sorted LL, merge these two sorted LLs into one sorted LL and then create a new tree using the merged list.
missed your videos!!!
Sorry for inconvenience
Bro why 3rd test case fails when submitted??
It's good to see you back bro. Hope you are doing good. By the way here is my solution: long long int findMaxProduct(vector<int>& arr) { // Write your code here int cnt=0,maxNeg=INT_MIN; long long ans = 1,mod = 1e9+7; for(int it:arr){ if(it < 0){ cnt++; maxNeg = max(maxNeg,it); } if(it != 0) ans = (ans*it)%mod; } if(arr.size() > 1 && (cnt & 1)) ans = ans/maxNeg; return ans; }
you have linked in account ? if yes give me link
Check the description please
I have been waiting for many long days ... finally it started again ..
Sorry for inconvenience
Bhai yr video q nai bana rhe ho itna din sa??
when will you upload graphs , heaps , dp etc ? your videos are great and much appreciated. Thank you big brother
Great, keep doing ❤
Brow all okay? Hope you are doing well..as you have not posted from last 3 days
thanks, one suggestion: please like use a better color to highlight the thing you're talking about, it was hard to know which 0 you were talking about in the matrix
Alright will take care of it
Nice approach.
it is not that easy as it tag ...
u explain well but handwriting can be improved ☺☺
Noted
My other solution using regex: a,b,c,d = re.findall(r'[0-9]+',str) p,q = int(a),int(b) r,s = int(c),int(d) if p/q > r/s: return a+'/'+b elif r/s > p/q: return c+'/'+d return "equal"
My python code: def compareFrac (self, str): a,b = str.split(",") b = b.strip() p,q = map(int,a.split("/")) r,s = map(int,b.split("/")) if p/q > r/s: return a elif r/s > p/q: return b return "equal" I think the time complexity will remain the same as split() takes O(n)
Bro i did this without using any loop😂🤣 constant time complexity
Please send the code It would help others too
seriuosly ?
@@trinitykhuman why are you shock like this , it is possible by the use of the ( find or boost::split functions in the c++) oor may be the use of (trim and split function in other language ). DON'T BE ENTERTAIN ANYONE 👍👍
But time complexity of split function is O(N)
@@sunitasunno hey bro, it's not about the entertain. Please don't mind if I make you feel like it.
If this the case that is Str="abbccc" X=1,y=2 X+y=3 odd Is this crt??
❤😊
sir jo aapne first brute force approach bataya hai uska TC O(n) hoga na ki O(n^2)?
O(N^2)
how sir i think only one travesal is sufficient to keep track of each node
bro formula for volume u calculated in here is different from which u implemented in the code , in the code u implemented volume=l^2 *(p/4)-(2*l); which i could n't find in here 5:40
Bhai how can we become like you😢
Here is my code which is easy to Understand: double l = (p - sqrt((p * p) - (24 * a))) / 12; double ans = (l * l) * ((p / 4) - (2 * l)); return ans;
could you explain how we got this formula as the original formula explained in the video was AL/2 -PL^2/4+L^3
@@user-vo3fr5qb6v simplifying equations
Bc problem toh chodo muze basic maths nahi samaz raha ab 🥲
Bro pls help it is getting stuck at 1110 test case I dont know whats the problem... // User function Template for Java class Solution { double maxVolume(double perimeter, double area) { // code here double h=(perimeter/2-Math.sqrt(perimeter*perimeter/4-6*area))/6; double v=h*area/2-h*h*perimeter/4+h*h*h; return v; } }
ans at 110 coming 1131004.73 but my output comes out to be 1131004.67
same problem here, too got 1110 / 1115 Passed Testcases My Code: double l = (p - sqrt((p * p) - (24 * a))) / 12; double ans = (l * a * 0.5) - (l * l * p * 0.25) + pow(l, 3); return ans;
Thanks for the amazing explanation
Glad it was helpful!
also tried to code based on given volume formula but it was failing for big test case your code logic seems different ...
No it's exactly same
Same problem...me doing in Java...it is getting stuck at 1110
why are you caculating twice perimeter - (sqrt(pow(perimeter, 2) - (24 * area)))) / 12, Please try to upload cleaner code
You can create one variable and use it once as well No problem in that too
yeh math ka question tha ya coding ka
Math