Skip to content

Practice Average Value of Even Numbers That Are Divisible by Three

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#2455
LeetCode Problem

Average Value of Even Numbers That Are Divisible by Three

Problem Statement

Given an integer array nums of positive integers, return the average value of all even integers that are divisible by 3. Note that the average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer.

Source: Average Value of Even Numbers That Are Divisible by Three on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,3,6,10,12,15]
Output
9

# Example 2

Input
nums = [1,2,4,7,10]
Output
0

Constraints

1 <= nums.length <= 1000
1 <= nums[i] <= 1000

Related LeetCode Problems

Practice more problems similar to Average Value of Even Numbers That Are Divisible by Three.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.