![Tech and Navid](/img/default-banner.jpg)
- Видео 48
- Просмотров 61 882
Tech and Navid
Добавлен 27 май 2015
Life, tech, and programming.
Group Anagrams | LeetCode | Solution Explained - Python
Group Anagrams | LeetCode | Solution Explained - Python
Просмотров: 55
Видео
Two Sum | O(n) | Technical Interview Solution Explained - Python
Просмотров 97Год назад
Two Sum | O(n) | Technical Interview Solution Explained - Python
Valid Parentheses LeetCode Solution Explained - Python
Просмотров 114Год назад
Valid Parentheses LeetCode Solution Explained - Python
Zig Zag Sequence | HackerRank | Solution Explained - Python
Просмотров 9 тыс.2 года назад
Zig Zag Sequence | HackerRank | Solution Explained - Python
Flipping the Matrix | HackerRank | Solution Explained - Python
Просмотров 32 тыс.2 года назад
Flipping the Matrix | HackerRank | Solution Explained - Python
Counting Sort 1 | HackerRank | Solution Explained - Python
Просмотров 3,8 тыс.2 года назад
Counting Sort 1 | HackerRank | Solution Explained - Python
Diagonal Difference | HackerRank | Solution Explained - Python
Просмотров 1,3 тыс.2 года назад
Diagonal Difference | HackerRank | Solution Explained - Python
Lonely Integer | HackerRank | Solution Explained - Python
Просмотров 2,4 тыс.2 года назад
Lonely Integer | HackerRank | Solution Explained - Python
Mini-Max Sum | HackerRank | Solution Explained - Python
Просмотров 1,1 тыс.2 года назад
Mini-Max Sum | HackerRank | Solution Explained - Python
Plus Minus | HackerRank | Solution Explained - Python
Просмотров 2,3 тыс.2 года назад
Plus Minus | HackerRank | Solution Explained - Python
Make Array Consecutive 2 Code Signal Solution Explained O(n) - Python
Просмотров 2792 года назад
Make Array Consecutive 2 Code Signal Solution Explained O(n) - Python
Integer to Roman LeetCode Solution Explained - Python
Просмотров 622 года назад
Integer to Roman LeetCode Solution Explained - Python
Two Sum Less Than K LeetCode Solution Explained - Python
Просмотров 4802 года назад
Two Sum Less Than K LeetCode Solution Explained - Python
Power of Four (Three and Two) LeetCode Solution Explained - Python
Просмотров 372 года назад
Power of Four (Three and Two) LeetCode Solution Explained - Python
Palindrome Number LeetCode Solution Explained - Python
Просмотров 432 года назад
Palindrome Number LeetCode Solution Explained - Python
Maximum Subarray LeetCode Solution Explained - Python
Просмотров 442 года назад
Maximum Subarray LeetCode Solution Explained - Python
Best Time to Buy and Sell Stock LeetCode Solution Explained - Python
Просмотров 832 года назад
Best Time to Buy and Sell Stock LeetCode Solution Explained - Python
I am looking at this issue for not too long to be honest but there is something I don't understand with this approach. Imagine matrix like this: 1000 42 83 119 56 1000 56 49 15 78 101 43 62 98 114 108 How could you ever swap 42 with 114 without relocating 1000 to another square and losing max sum in that angle ? The solution you wrote just takes highest mirror number and adds it to the sum, but it doesn't check if that rotation is optimal.
W
The Google Certified Associate Developer is a valuable credential that demonstrates understanding and skill in using Google tools and platforms, such as Google Cloud, Firebase, and Android.
Learners will improve their ability to use Google tools and technologies, which can be applied in software development projects and solve technical problems
This is true, it is one of the most fundamental skills in software engineering.
This provides the opportunity to learn and prepare for exams but also facilitates skill enhancement and expands career opportunities in the technology industry.
I initially thought that it is how you needed it
BAHAHAHHA I just realized my screen share was not working when I went into full screen! The whole stream is just my wall paper. Oh boy, OBS is funny.
lol you were typing wrong lol. you wrote key everytime before until you wrote key lol
actually 😂
Yo! your video is dope keep it up!!
Appreciate you. 💯
Studying for an exam while coworking with you-thanks for the awesome vibes!
Good luck!! Thanks for coming!
Hi! I came here to confirm that the problem is not well written, because if you flip a column [0] (leftmost column) for instance, [0][0] and [1][0] move together (top two values of leftmost column). which means that you cannot calculate the value per cell individually. rather, one would have to calculate the sum of the whole matrix within the possible universe of column/row combinations, since individual grids dont move or flip individually. Additionally, the problem states that N can be much larger than a 4x4 matrix. Which means that this drawing and corresponding calculations will not match a 6x6 or a 8x8 grid. At least from my perspective. In any case, thanks for sharing, since i couldnt be sure the problem and questions were wrong before i actually saw your video! I spent the while 20 mins without putting a character on screen...
I like your approach to solving the problem! it help me understand better!
I can say this was very enjoyable bro keep up the good work it will all pay off I'm in the same boat as you but I'm doing front end and to lead into full stack soon I start uni courses next month and will be learning git and github through Codecademy also and the frontend through freecodecamp and YK going back and forth with the two websites as I grow in college
clear explanation, thanks
Disclaimer*** Memory errors, will both throw and error both at runtime, regardless of a compiled or interpreted language. I did a poor job of explaining a metaphor of how compiled languages will throw errors and not work when there is an error but using an example of exceeding memory, which is not an actual error but, in fact, just a space complexity concern. Just pretend that the space complexity error of "Time Limit Exceeded" for the leetcode example is an actual Java Syntax error, and the explanation makes more sense. Apologies again.
Why do you choose this course from codeacademy instead other online courses?
Codecademy is a great platform and has a n integrated IDE and env (also I have a premium membership that ends in september)
what's your stream schedule?
I currently do not have one, though I stream usually around the hours 10-3PM EST or 7-9 PM EST
isn't your mind exhausted by coding 2hours straight
Hanging out on stream with folks definitely helps!
Don't usually comment on videos, but the matrix implementation is actually so genius, I would have never figured this out. Appreciate the step by step explanation, it's so valuable for someone like myself :)
Please give me Github link.
This is really cool and solves matrix problems very quickly
!
Figured this out quickly and put it into practice really well
Nice work!
interesting, but what if we got a number that appears more than 2 times ?? that won't work
Thank you very much for this videos. They are really amazing
Thank you!
Its greedy method, there is another method as well which i dont even understand after scratching my head to bleeding.
Thanks for the solution. humbled. But at the same time looking at comments I am happy that there are many others like me out there :)
This is a super elegant solution. But can we assume that there is always a possible solution for any initial configuration of values and for any matrix size, considering that when flipping a row, we distort columns and vice versa?
This question is a great example of what's wrong with a lot of tech interviews. To solve this in the given time you would have had to memorize the algorithm ahead of time. What someone has memorized doesn't show me what happens when they are faced with a new problem that you can't google. In an interview I might ask someone to tell me how they might solve it so I can get an idea of how they solve problems. I am more interested in how someone might solve a problem they have never seen. Not getting the exact answer in 30 minutes.
Your solution works for the sample matrix (and apparently for all matrices in the test cases), but I don't understand why your solution works in the general case. Let's label our top row's elements as: [A1, B1, B2, A2] Assume the following values: [100, 3, 101, 3] In our first iteration, to see if we should add A1 or A2, we pick A1. We move to the B1 element now, we decide to swap it for B2. Doing this means we also switch A1 and A2 again, because we can only reverse per row (and per column). If I understand correctly, your algorithm's intermediate sum would now be equal to 100 + 101, but this should not be possible, afaik.
Thank you!
I fucking double dare someone to deduce this solution, seeing the problem for the first time in 24 minutes
Do you not also have to get max vals for B, C, and D to find the max sum for the entire quadrant (not just the A corner)?
I wasn't paying attention to the fact that the array should have 100 0's so I was getting 99 positions instead of 100. Thank you for clarifying.
respect! Great solution
Doesn't work if an integer appears more than twice in the array.
i was able to find the logic but not able to find the [n-i-1] and [n-j-1] formula to get that particular index
Great explanantion. Thank u.😍😍😍😍😘
Thx for the video
thank you! that was very clear
Glad it was helpful!
thank you so much man
Happy to help!
First try taking it, I really having hard time solving it myself and just give up before the times up. Big thanks for the intuition.
The problem is so confusing I couldn't understood it at all at first. Thanks for the video
Makes me happy that I helped :)
im dying to know the solution of this. this problem is insane
Thanks for your video. I didn't fully watch it, but just seeing the matrix drawing you made and how the mirroring works was enough to get me through the problem. This problem, along with "Counting Valleys" has taught me that what the text says doesn't really matter, it's all about the expected output. Literally reversing rows until you get to the result can be a huge computational effort, but once you understand that you really just need to find the biggest number among each set of mirrored elements and sum them, the problem gets much easier and just throws all the reversing and flipping away.
The most difficult job in the world is solving problems through code,need lots of thinking🤔
is there a way to solve this using .append() ?
guys screen got stuck at 10:06 can anyone provide the complete solution. upto this point im only able to see of to flip the A's. dont know how to flip the C,B and D's
I got same output but showing wrong answer for this method
reset the code and only modify the lines shown in the tutorial, adding new lines or removing them isn't allowed.
arr_rev = [i[::-1] for i in arr] sum_lt_rg_diag = [arr[i][i] for i in range(len(arr))] sum_rg_lt_diag = [arr_rev[i][i] for i in range(len(arr_rev))] return abs(sum(sum_lt_rg_diag) - sum(sum_rg_lt_diag))
You saved my day! Bless you sir