Equal Row and Column Pairs - Leetcode 2352 - Python

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • This video talks about solving a leetcode problem which is called Equal Row and Column Pairs.
    Problem Link: leetcode.com/p...
    Leetcode playlist 👉 tinyurl.com/bd...
    Follow me on Twitter 👉 / techwired8
    Like 👍
    Share 📣
    Comment 💬
    Click this link to Subscribe 👉 tinyurl.com/4e...
    Press the Bell icon🔔for updates
    #python #leetcode #coding #programming

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

  • @techerror8
    @techerror8  Год назад +1

    Hello Guys, DON'T FORGET To LIKE & Subscribe. Press the Bell icon🔔for notification :)

  • @Fido1hn
    @Fido1hn 8 дней назад +1

    Short, sweet and clear, thank you sir.

    • @techerror8
      @techerror8  8 дней назад +1

      Glad it was helpful! Subscribe for more: )

    • @Fido1hn
      @Fido1hn 7 дней назад

      @@techerror8 subscribed

    • @techerror8
      @techerror8  7 дней назад +1

      @@Fido1hn Thanks for your support :)

  • @safiullahshah8550
    @safiullahshah8550 2 месяца назад +1

    That's a really pretty solution. Learnt a few new tricks. Thanks!

    • @techerror8
      @techerror8  2 месяца назад +1

      Glad it Helped :) Subscribe for more :)

  • @rafaelnadal5892
    @rafaelnadal5892 Год назад +1

    Amazing! thank you so much

    • @techerror8
      @techerror8  Год назад +1

      Glad it Helped :) Subscribe for more :)

  • @mohamedhussien4013
    @mohamedhussien4013 10 месяцев назад +1

    Nice solution.

    • @techerror8
      @techerror8  9 месяцев назад +1

      Glad it Helped :) Subscribe for more :)

  • @sachinsuvarna3718
    @sachinsuvarna3718 5 месяцев назад +2

    can anybody explain zip(*grid)? why we have to give * ?

    • @techerror8
      @techerror8  4 месяца назад +1

      Without the *, zip() would expect a single iterable containing other iterables. For example, zip([1, 2, 3], [4, 5, 6]) would produce [(1, 4), (2, 5), (3, 6)], where each inner iterable is paired element-wise.
      With the *, it unpacks the provided iterable into individual arguments. For instance, zip(*[[1, 2, 3], [4, 5, 6]]) would essentially become zip([1, 2, 3], [4, 5, 6]). Hope this Helps :) Subscribe for more :)

  • @Imsakunthala
    @Imsakunthala Год назад +1

    Could you please explain why did you convert this to defaultdict to tuples? instead of list !
    Can you please explain in detail!

    • @techerror8
      @techerror8  Год назад +2

      The defaultdict is not necessary for this specific implementation. A regular dictionary would suffice. The conversion of rows and columns to tuples is done to ensure immutability and allow them to be used as dictionary keys. By converting the rows and columns to tuples, we can use them as keys in the rowCounts dictionary, which requires hashable keys. The use of tuples ensures that rows and columns are represented consistently and can be easily compared and used as dictionary keys. Hope this Helps :)

    • @Imsakunthala
      @Imsakunthala Год назад +1

      @@techerror8 Thank you so much Team!

  • @neerajchouksey3761
    @neerajchouksey3761 6 месяцев назад +1

    what zip(*grip) does

    • @sachinsuvarna3718
      @sachinsuvarna3718 5 месяцев назад

      zip(*grid) in Python is a convenient way to transpose or "unzip" a list of iterables into separate iterables, grouping corresponding elements from each iterable into tuples