LeetCode 48: Rotate Image | Rotate N*N Matrix | Rotate a Square - Interview Prep Ep 54

preview_player
Показать описание


⭐ Support my channel and connect with me:

Solutions explained:
Solution #1:
Rotate every four elements on each of the four sides at a time, this way, we'll only use constant memory:
Time: O(n^2)
Space: O(1)

Solution #2:
We can first transpose the matrix diagonally, then reverse every row.
Time: O(n^2)
Space: O(1)

// TOOLS THAT I USE:

// MY FAVORITE BOOKS:

My ENTIRE Programming Equipment and Computer Science Bookshelf:

And make sure you subscribe to my channel!

Your comments/thoughts/questions/advice will be greatly appreciated!

#softwareengineering #leetcode #algorithms #coding #interview #SDE #SWE #SiliconValley #programming #datastructures
Рекомендации по теме
Комментарии
Автор

Fantastic! I cannot imagine how painful it have would been to create the presentation (meticulously coloring the cells on each slide), then walk through it by recording a video, editing the video, and then doing the live coding to demo it at the end as part of the video! Truly appreciate your efforts and thank you for making it.

staffeng
Автор

Fisher, your video is great! Thanks for being so patient to explain step by step. In addition, having 2 popular methods explained and coded are very helpful.

annas
Автор

These videos are highly appreciated! Thanks for your hard work. What would be more helpful is you pick a topic, say trees, and have a series/playlist where you talk about some theory and solve leetcode questions along the way (from easy to harder questions). That way newbies like me can approach problems for that topic in a more easier manner.


Thoughts appreciated :)

vishnugovindan
Автор

Great explanation, I saw another person do transposing using a different range but the way you did it and put images really helped me see how it works. Thank you!

tonynguyen
Автор

Great explanation! this deserves to be on top of search results

MrVschaitu
Автор

This is very intuitive and MUCH BETTER than the official solutions #1, #2, and #3 provided by Leet Code. 加油

yixing
Автор

Beautiful explanation. Came across this in cracking the coding interview. Lot of explanations didn't make sense. Yours was the only one that helped me understand. Thank you for making this video! Truly appreciate it.

akshayvish
Автор

This is awesome and finally understood this!

numberjuan
Автор

This is the best breakdown of this problem I've ever seen. Fantastic work!

trchew
Автор

Solution 2 seems to be pretty simpler than solution 1. I didn't know this second solution, it helped me a lot to understand a different way. Thank you!!!

MgThompson
Автор

I really appreciate your explanation! very clear to me! Good Job!

mariagu
Автор

Great explanation! Thank you for posting this video.

MsSra
Автор

I spent so much time trying to figure this out but your video did helped me a lot to finally understand, Thank you!

juanmoctezuma
Автор

I had a really hard time understanding how to do this. Your explanation took me over the finish line to understanding it. Thank you!!

zahirjacobs
Автор

Thanks very much for walking through two solutions and your effort ! Excellent explanation and presentation. THANKS !

suwin
Автор

Thank you for this explanation, it is a lot better at explaining the rational for the loop bounds than LC's solution.

greyreynyn
Автор

This is awesome! I appreciate your effort to explain it clearly. You are the best.

daliakamal
Автор

very nicely explained dude! keep it up!

divyanshusharma
Автор

One of the best examples out there! great job, thanks a lot.

vigneshsr
Автор

This was the only explanation for this question i was able to understand. i love it

caldlyde