3380. Maximum Area Rectangle With Point Constraints I | Array | Sorting | Math

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

КОМЕНТАРІ • 5

  • @ARYANMITTAL
    @ARYANMITTAL  13 днів тому +5

    Agar accha lage & aur Contest Solutions ke naam pr ek like thok dena plssss

  • @Jazzimus
    @Jazzimus 12 днів тому

    Another optimization over this: we actually only need 2 points (the opposite points) to define a rectangle. Let these opposite points be some: (xi, yi) and (xj, yj). Then the other 2 opposing points will be: (xi, yj), (xj, jy). We can check for their existence via a map (after storing them obviously), and then finding area and and checking for inside points can be the same. This lowers complexity from O(n^5) to O(n^3), since we are only brute forcing a combination of 2 points. This allows the code to pass for n

  • @ajayc815
    @ajayc815 13 днів тому

    🥰🥰🥰🥰🥰

  • @srinivasnakka4960
    @srinivasnakka4960 13 днів тому

    Today last question
    Consider every point as top left point and binary search for left closest point to it and with same y cordinate then same way for bottom closest point with same x coordinate then we get fourth point now there one more thing you need to check is there any point in the formed rectangle . I am not sure is there any standard searching algorithm in cpp for this kind of search

  • @Its_Shubham_Negi
    @Its_Shubham_Negi 13 днів тому

    Today's last q involved fenwick trees ig