LC contest problems summary

November 28, 2021 2 min read

[Biweekly-66 (27th Nov, 2021)](https://leetcode.com/contest/biweekly-contest-66/)

  1. 2085. Count Common Words With One Occurrence

Use hashmap (Counter)

  1. 2086. Minimum Number of Buckets Required to Collect Rainwater from Houses" First put the bucket at best place and the remove those covering home. Answer is (best bucket cnt + remaining house). Corner case: check for each house is coverable

  2. 2087. Minimum Cost Homecoming of a Robot in a Grid djikstra will fail. why ? Too many cells to cover (10**10). Think of something else To reach home, which path you need to take ? (cost is non-negative) To reach home, number of rows and number of cols changes are fixed.

  3. 2088. Count Fertile Pyramids in a Land Deconstruct pyramid into smaller part and then think to calculate how many pyramids are there we can calculate left and right perpendiculars and then construct pyramids from them calculate for normal and flipped version of grid

[Weekly-269 (28th Nov, 2021)](https://leetcode.com/contest/weekly-contest-269)

  1. 2089. Find Target Indices After Sorting Array Implementation
  2. 2090. K Radius Subarray Averages Prefix sum
  3. 2091. Removing Minimum and Maximum From Array Greedy cases to minimize number of remove min(r+1, n-l, l+1+(n-r)). here l and r are index of max and min elements (l < r).
  4. 2092. Find All People With Secret sort by time and try to share secret at current timestamp, find connected components and color all nodes if one of them have seen secret