2D Prefix Sum Interview Pattern | 221 Maximal Square
Last problem on Prefix Sum Interview Pattern!
This one uses Binary Search on Answer as well.
Link: leetcode.com/problems/maximal...
Connect with me on Linkedin: / bharat-khanna-717b4817b
Connect on Insta: / bharatkhanna1995
00:00-01:40 Problem Introduction
01:41-04:20 Brute Force
04:21-10:30 Prefix Sum for O(N^3)
10:31-14:21 Binary Search on Answer
14:22-21:18 Code
Пікірлер: 10
Great Explanation!!
@CodingwithBharat
4 ай бұрын
Thanks ✌️
Nice explanation bhaiya !!!!
@CodingwithBharat
4 ай бұрын
Thanks 😁
Nice Video keep it up Bhaiya
@CodingwithBharat
4 ай бұрын
Thanks ✌️
this was surely not a medium question :P BS on answers + prefixSum
@CodingwithBharat
4 ай бұрын
There is a dp solution as well which is more straightforward but with these concepts - yes, a tough one!
public int maximalSquare (char[][]matrix){ int m=matrix.length,n=matrix[0].length; int[]dp=new int[n]; maxLen=0,prev=0; for(int i=0;i
@CodingwithBharat
4 ай бұрын
Yup that exists too. But doesn’t use our pattern :)