Leetcode 2392. Build A Matrix With Conditions | Weekly Contest 308.
ฝัง
- เผยแพร่เมื่อ 5 ก.ย. 2024
- Use coupon ALISHA on any GeeksforGeeks course to get 10% discount:
practice.geeks...
Connect with me on LinkedIn : / alisha-parveen-80579850
Check out our other playlists:
Dynamic Programming:
• Dynamic Programming
Trees:
• Trees
Heaps and Maps:
• Heaps and Maps
Arrays and Maths:
• Arrays and Maths
Bit Manipulation:
• Bit Manipulation
Greedy Algorithms:
• Greedy Algorithms
Sorting and Searching:
• Sorting and Searching
Strings:
• Strings
Linked Lists:
• Linked Lists
Stack and Queues:
• Stacks and Queues
Two Pointers:
• Two pointers
Graphs, BFS, DFS:
• Graphs, DFS, BFS
Backtracking:
• Backtracking
Non- DSA playlists:
Probability:
• Probability
SQL-Basic Join functions:
• SQL - Basic JOIN Funct...
SQL-Basic Aggregate functions:
• SQL-Basic Aggregate Fu...
vector buildMatrix(int k, vector& rowConditions, vector& colConditions) {
vectorrow_order = kahn(rowConditions, k+1); //[1,4,3,2]
vectorcol_order = kahn(colConditions, k+1); // [1,4,2,3]
// map -> {1 :0, 4:1, 2:2, 3:3}
unordered_mapm;
if(row_order.size()
Leetcode POTD. Good explanation. Thank you.
Awesome video ma'am! Thanks for the great explanation, owe my career to you
Thankyou so much! This literally cleared so many doubts not only regarding the question but also regarding writing clean codes with c++
actually pretty good Explanation !
Mam please aap bhot dino se active nhi hai contest review nhi de rhi hai ...Aap ka content bhot hi acha hota hai please post video on Leetcode contests
thanks
Thanks for such nice explanation!
Thank you so much Himadri!
Awesome explanation
U made hard prblm easy by ur explanation.
Thank u so much. Please Keep making videos for upcoming contests also
Thank you so much Azeem, will surely try to upload :)
I'll probably not get an answer but still, when I opened my soft Roll I couldn't place the "notes" or however you call them that finely, by
great solution, i was thinking of calculating all topo sorts and then matching row and column conditions , also canyou please mention complexity of algo
Had mentioned, O(k2)
Thanks Pranay!
Maam Please aaap Leetcode contest ka discussion krriye Ma'am
It would be beneficial if you also mentioned time and space complexity. Also, many thanks for your clear explanation!
Have mentioned, it is O(k2)
@@probabilitycodingisfunis1 Maybe I skipped that part. Thank you!
addicted to this channel.Thank you so much mam
Mind Blowing
Amazing Explanation
nice explanation you made it easy problem .looking forward to learn lot from you
Thanks Rahul!
The explanation was very good.
Thanks for this solution video.
Thank you so much Sanyam!
Java solution
class Solution {
public int[][] buildMatrix(int k, int[][] rowConditions, int[][] colConditions) {
List rowOrder = topoSort(rowConditions,k);
List colOrder = topoSort(colConditions,k);
if(rowOrder.size()
HEY YOU soft LIKE AI AND TNice tutorialS VID SO HELPFUL
Amazing explanation.
How did you deduced this problem is a graph problem. Is it because of ordering of numbers, leading to topological sort?
Thanks Syed, yes!
i love this channel
God level explanation. 🔥🔥
Nicely explained
Can you please share some good resource to learn graph
@Sahil Anand, would recommend GeeksforGeeks / Abdul Bari's TH-cam Channel / Prateek Narang course on Graphs on Udemy
code n code graph series
Sa here bro
Tqs ali i m yr big fan 🎉🎉
Hey Alisha, Interview me DP me "top down with memorization" approach se batane se kam chal jata h kya ya phir interviewer ko "bottom up iterative" bhi chahiye hota h
di ab toh apka placement ho gaya, phir kyun practice kar rahe?