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

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 17

  • @sailendrachettri8521
    @sailendrachettri8521 16 днів тому +2

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

    • @techdose4u
      @techdose4u  16 днів тому +1

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

  • @SantoshKumar-rt1it
    @SantoshKumar-rt1it 17 днів тому +2

    best explanation of solution

  • @PCCOERCoder
    @PCCOERCoder 16 днів тому +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 16 днів тому

    Thank you sir

  • @prakhargarg4166
    @prakhargarg4166 17 днів тому

    Thankyou, sir

  • @PRANAVMAPPOLI
    @PRANAVMAPPOLI 17 днів тому

    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 17 днів тому

      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  17 днів тому

      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.

  • @saikishanrao4150
    @saikishanrao4150 16 днів тому

    nice

  • @21flame72
    @21flame72 16 днів тому

    Thankyou sir