Minimum Time to Visit a Cell In a Grid | Leetcode 2577

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

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

  • @sailendrachettri8521
    @sailendrachettri8521 28 дней назад +2

    Leetcode is throwing hard level question frequently
    Your explanation is always best :)

    • @techdose4u
      @techdose4u  28 дней назад +1

      Yeah, Leetcode is getting tougher!
      As do the interviews :)

  • @SantoshKumar-rt1it
    @SantoshKumar-rt1it 28 дней назад +2

    best explanation of solution

  • @PCCOERCoder
    @PCCOERCoder 28 дней назад +1

    please increase the font size when you are showing the code or the problem. It will help a lot for mobile users. Hope so you see this comment!

  • @PCCOERCoder
    @PCCOERCoder 28 дней назад

    Thank you sir

  • @PRANAVMAPPOLI
    @PRANAVMAPPOLI 28 дней назад

    Why we are not checking is there a better other option ro reach a cell or not.
    Here we are just use a visited set, buy usually im dijakastra we will compare
    if crntTime

    • @PRANAVMAPPOLI
      @PRANAVMAPPOLI 28 дней назад

      class Solution:
      def minimumTime(self, grid: List[List[int]]) -> int:
      rows=len(grid)
      cols=len(grid[0])
      time=[[float('inf')]*cols for _ in range(rows)]
      heap=[(grid[0][0],0,0)]
      direc=[(0,1),(0,-1),(-1,0),(1,0)]
      time[0][0]=grid[0][0]
      if grid[0][1] > 1 and grid[1][0] > 1:
      return -1

      def isValid(i,j):
      return 0

    • @techdose4u
      @techdose4u  28 дней назад

      Nope,
      coz here the result may differ by value of 1 of you just push without calculating based on even odd diff. That I had explained in the video.
      That calculation of even odd diff is the only difference. Rest everything is same.

  • @prakhargarg4166
    @prakhargarg4166 29 дней назад

    Thankyou, sir

  • @saikishanrao4150
    @saikishanrao4150 28 дней назад

    nice

  • @21flame72
    @21flame72 28 дней назад

    Thankyou sir