Tap here to switch tabs
Problem
Submissions

Problem: Most Frequent Even Element

med
30 min
Try to solve the Most Frequent Even Element problem.

Statement

Given an integer array nums, return the most frequent even element. If there is a tie, return the smallest one. If no even element exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤2000\leq 2000

  • 0≤0 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Most Frequent Even Element

med
30 min
Try to solve the Most Frequent Even Element problem.

Statement

Given an integer array nums, return the most frequent even element. If there is a tie, return the smallest one. If no even element exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤2000\leq 2000

  • 0≤0 \leq nums[i] ≤105\leq 10^5