Skip to content

Weekly History

weekly 396

number description solution
3136 Valid Word set some flags and one-pass scan solution
3137 Minimum Number of Operations to make word k-periodic frequency map of each segment,找到最大频率的字段word[i:i+k] solution
3138 Minimum Length of Anagram Concatenation 找到一个string中的最长anagram, 等价在所有char的频率hash表里,找到频率的gcd(greatest common divisor) solution
3139 Minimum Cost to Equalize Array - -

weekly 392

number description solution
3105 Longest Strictly Increasing or Strictly Decreasing Subarray 维护两个int来计算当前为止最长的严格单调递增和递减数组 solution
3106 Lexicographically Smallest String After Operations With Constraint 从左到右的给s整容,每次整容先从a整到z. 需要做个计算distance的helper function. solution
3107 Minimum Operations to Make Median of Array Equal to K 排序后,vertical line for y = k, 然后"移动"数组让y=k至少正好有超过数组一半的数 solution
3108 Minimum Cost Walk in Weighted Graph - -

weekly 391

number description solution
3099 Harshad Number simple math solution
3100 Water Bottles II simulation, drinking phase + exchange phase solution
3101 Count Alternating Subarrays sliding window solution
3102 Minimize Manhattan Distances - -

weekly 352

number description solution
2760 Longest Even Odd Subarray with Threshold
2761 Prime Pairs with Target Sum
2762 Continuous Subarray
2763 Sum of inbalance number of all subarrays

weekly 351

number description solution
2748 Number of Beautiful Pairs - solution
2749 Minimum Operations to make the integer zero - -
2750 Ways to Split Array into Good Subarrays - -
2751 Robot Collisions - -

Weekly 350

First time join contest, got 0/4. Attend virtual, after 2 months of grinding, got 2/4.

number description solution
2739 Total Distance Traveled very simulation, math solution
2740 Find the Value of the Partition sort + brute force solution
2741 Special Permutation dp + bitmask -
2742 Painting the Walls - -