LeetCode 221. Maximal Square [ Algorithm + Code Explained]
HTML-код
- Опубликовано: 8 окт 2024
- One of the most frequently asked coding interview questions on 2D Array in companies like Google, Facebook, Amazon, LinkedIn, Microsoft, Uber, Apple, Adobe etc.
LeetCode : Maximal Square
Problem URL - leetcode.com/p...
Question :Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
Example:
Input:
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0
Output: 4
Connect with me on LinkedIn at: / jayati-tiwari
I have watched two of your videos after I got stuck, and I must say they were very precisely explained. I'd suggest you to change the thumbnails as they aren't attractive and are similar to other channels that show up on search and do not explain properly. One might assume your channel to be one of these channels which really isn't the case. Try a template like Nick White.
Your cheatsheet/flashcards are so helpful. Do you mind sharing all them ? That would be great !
line 10 and 14: dp[i][0] = matrix[i][0];
The shorthanded if else statement is not needed
matrix[x][y] only has two values either 0 or 1
Yes exactly
We have to store int values in dp but char values are given to us. That's why if else is used to convert them into int.
please make a video on your journey to yelp? preparations too
Thanks dii
this one is pretty standard and common DP problem ,everyone must have done already
There are many folks who are beginning with data structures and this channel is to help them as well. Hence, the channel contains a mix of various problems of different difficulty level. Feel free to filter out as per your requirement.
@@jayatitiwari444 please have challenging problems in parallel
Hey plz solve jumping problem which I send u with link