3235. Check if the Rectangle Corner Is Reachable | Weekly Leetcode 408

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 13

  • @devilronak7262
    @devilronak7262 Před měsícem +1

    Its not handling case when circle is outside the rectangle , can u send the updated code which handles that also

  • @talwaarkidhaar
    @talwaarkidhaar Před 6 dny

    It wont handle cases where 2 circles contact point is outside the rectangle, Even though circles touch the rectangle side.
    circle(1|49 35)
    circle(49|1| 35)
    rectangle(0|0 15 15)

  • @aaravarya4406
    @aaravarya4406 Před měsícem +1

    We can handle the edge case when the circle is completely outside the rectangle by simply excluding those circles from consideration.

  • @nikhilsoni2403
    @nikhilsoni2403 Před měsícem +1

    Thanks a lot ❤😊

  • @darkknight98-v
    @darkknight98-v Před měsícem

    really good explanation! thanks a lot

  • @devilronak7262
    @devilronak7262 Před měsícem

    Now its giving wrong answer ig guess the testcases are updated, can u send the updated code by using dsu

  • @sudhadevi6692
    @sudhadevi6692 Před měsícem +1

    Bhaiya yesterday was gfg contest and it's q2 says that u have to find the largest subarray whose some is equal to its length.
    And I am not getting that how can we solve it in O(N) bcoz we to check at each i , all the various length. Mens sum -1 length, sum-2 length is present in the map or not.
    Plz see that question one time.

  • @quyhoaphantruong7453
    @quyhoaphantruong7453 Před měsícem

  • @kashishchawla2754
    @kashishchawla2754 Před měsícem

    what is entire circle is outside the rectangle?

    • @codingmohan
      @codingmohan  Před měsícem

      It wouldn't matter because when you find the minX, minY, maxX, maxY for such group of circles, it wouldn't satisfy the criteria of any of the 4 barriers.

    • @aadishjain2378
      @aadishjain2378 Před měsícem

      ​@@codingmohan I think it can satisfy the condition. Consider a circle with center way above rectangle. The radius may be large enough so that the left end may be less than 0 and the right end may be greater than X. This will satisfy the horizontal line condition even though the circle doesn't even intersect the rectangle.

    • @devilronak7262
      @devilronak7262 Před měsícem

      @@aadishjain2378yaa thats what , @codingmohan can u check this