LeetCode Biweekly Contest 50
| Rank | Name | Score | Finish Time | Q1 (3) | Q2 (4) | Q3 (5) | Q4 (6) |
|---|---|---|---|---|---|---|---|
| 1032 / 10097 | YoungForest | 12 | 0:20:28 | 0:09:10 | 0:12:51 | 0:20:28 | null |
I was eight minutes late because of showering; otherwise I should have been able to enter the top 500.
This biweekly contest was a disguised hand-speed contest, with 141 people solving all four problems. The rest was a competition of speed on the first three problems.
I smoothly finished the first three problems in 10 minutes, but thought about Q4 for an hour without making a major breakthrough.
Although I had a few clues and felt it was a DP problem, afterward I found that the problem had already gone beyond the syllabus, so not solving it was normal.
1827. Minimum Operations to Make the Array Increasing
Greedy. While maintaining increasing order, keep the numbers as small as possible.
1 | class Solution { |
Time complexity: O(N),
space complexity: O(1).
1828. Queries on Number of Points Inside a Circle
Because the number of points and circles are both small (<= 500), direct brute force is enough.
1 | class Solution { |
Time complexity: O(points.length * queries.length),
space complexity: O(queries.length).
1829. Maximum XOR for Each Query
Use prefix sum, actually prefix XOR, to quickly perform the Remove operation, then construct k by complementing bits.
1 | class Solution { |
Time complexity: O(nums.length * maximumBit),
space complexity: O(nums.length).