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

Комментарии • 11

  • @utkarshgoel4568
    @utkarshgoel4568 4 года назад +3

    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.

  • @harinijeyaraman8789
    @harinijeyaraman8789 3 года назад +1

    Your cheatsheet/flashcards are so helpful. Do you mind sharing all them ? That would be great !

  • @leomonz
    @leomonz 4 года назад +1

    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

    • @MGtvMusic
      @MGtvMusic 3 года назад

      Yes exactly

    • @saketjoshi2287
      @saketjoshi2287 3 года назад

      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.

  • @callmechocolateboy
    @callmechocolateboy 4 года назад +2

    please make a video on your journey to yelp? preparations too

  • @DeviDevi-yr2sv
    @DeviDevi-yr2sv 2 года назад

    Thanks dii

  • @code7434
    @code7434 4 года назад

    this one is pretty standard and common DP problem ,everyone must have done already

    • @jayatitiwari444
      @jayatitiwari444  4 года назад +3

      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.

    • @code7434
      @code7434 4 года назад

      @@jayatitiwari444 please have challenging problems in parallel

    • @samsah6324
      @samsah6324 4 года назад

      Hey plz solve jumping problem which I send u with link