leetcode.cn 2025-09-22
🟢3005.count-elements-with-maximum-frequency
🏷️ Tags
#array #hash_table #counting
🟢3005.count-elements-with-maximum-frequency
🏷️ Tags
#array #hash_table #counting
Telegraph
count-elements-with-maximum-frequency
给你一个由 正整数 组成的数组 nums 。 返回数组 nums 中所有具有 最大 频率的元素的 总频率 。 元素的 频率 是指该元素在数组中出现的次数。 示例 1: 输入:nums = [1,2,2,3,1,4] 输出:4 解释:元素 1 和 2 的频率为 2 ,是数组中的最大频率。 因此具有最大频率的元素在数组中的数量是 4 。 示例 2: 输入:nums = [1,2,3,4,5] 输出:5 解释:数组中的所有元素的频率都为 1 ,是最大频率。 因此具有最大频率的元素在数组中的数量是 5 。 …
leetcode.com 2025-09-22
🟢3005.count-elements-with-maximum-frequency
🏷️ Tags
#array #hash_table #counting
🟢3005.count-elements-with-maximum-frequency
🏷️ Tags
#array #hash_table #counting
Telegraph
count-elements-with-maximum-frequency
You are given an array nums consisting of positive integers. Return the total frequencies of elements in nums such that those elements all have the maximum frequency. The frequency of an element is the number of occurrences of that element in the array. …
leetcode.cn 2025-09-26
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
Telegraph
valid-triangle-number
给定一个包含非负整数的数组 nums ,返回其中可以组成三角形三条边的三元组个数。 示例 1: 输入: nums = [2,2,3,4] 输出: 3 解释:有效的组合是: 2,3,4 (使用第一个 2) 2,3,4 (使用第二个 2) 2,2,3 示例 2: 输入: nums = [4,2,3,4] 输出: 4 提示:
leetcode.com 2025-09-26
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
Telegraph
valid-triangle-number
Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle. Example 1: Input: nums = [2,2,3,4] Output: 3 Explanation: Valid combinations are: 2,3,4 (using the first…
leetcode.com 2025-09-29
🟡1039.minimum-score-triangulation-of-polygon
🏷️ Tags
#array #dynamic_programming
🟡1039.minimum-score-triangulation-of-polygon
🏷️ Tags
#array #dynamic_programming
Telegraph
minimum-score-triangulation-of-polygon
You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex in clockwise order. Polygon triangulation is a process where you divide a polygon into a set of…
leetcode.cn 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
给你一个下标从 0 开始的整数数组 nums ,其中 nums[i] 是 0 到 9 之间(两者都包含)的一个数字。 nums 的 三角和 是执行以下操作以后最后剩下元素的值:
leetcode.com 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
You are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive). The triangular sum of nums is the value of the only element present in nums after the following process terminates: