[LeetCode] Button with Longest Push Time

3386. Button with Longest Push Time

You are given a 2D array events which represents a sequence of events where a child pushes a series of buttons on a keyboard.

Each events[i] = [indexi, timei] indicates that the button at index indexi was pressed at time timei.

  • The array is sorted in increasing order of time.
  • The time taken to press a button is the difference in time between consecutive button presses. The time for the first button is simply the time at which it was pressed.

Return the index of the button that took the longest time to push. If multiple buttons have the same longest time, return the button with the smallest index.

Read more
[AtCoder] E - Sensor Optimization Dilemma 2Read more
[AtCoder] E - How to Win the ElectionRead more
[AtCoder] A - AppraiserRead more
[AtCoder] E - Avoid K PartitionRead more
[AtCoder] E - Sightseeing TourRead more
[AtCoder] E - Permute K timesRead more
[AtCoder] F - Rearrange QueryRead more
[AtCoder] E - Manhattan Multifocal EllipseRead more
[LeetCode] Maximum Area Rectangle With Point Constraints II

3382. Maximum Area Rectangle With Point Constraints II

There are n points on an infinite plane. You are given two integer arrays xCoord and yCoord where (xCoord[i], yCoord[i]) represents the coordinates of the ith point.

Your task is to find the maximum area of a rectangle that:

  • Can be formed using four of these points as its corners.
  • Does not contain any other point inside or on its border.
  • Has its edges parallel to the axes.

Return the maximum area that you can obtain or -1 if no such rectangle is possible.

Read more