Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0ec4e19

Browse files
add 2455
1 parent 05cedd9 commit 0ec4e19

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------|-------------
11+
| 2455 |[Average Value of Even Numbers That Are Divisible by Three](https://leetcode.com/problems/average-value-of-even-numbers-that-are-divisible-by-three/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2455.java) || Easy ||
1112
| 2432 |[The Employee That Worked on the Longest Task](https://leetcode.com/problems/the-employee-that-worked-on-the-longest-task/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2432.java) || Easy ||
1213
| 2427 |[Number of Common Factors](https://leetcode.com/problems/number-of-common-factors/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2427.java) || Easy ||
13-
| 2404 |[Most Frequent Even Element](https://leetcode.com/problems/most-frequent-even-element/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2404.java) || Easy ||
14+
| 2404 |[Most Frequent Even Element](https://leetcode.com/problems/most-frequent-even-element/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2404.java) || Easy ||
1415
| 2399 |[Check Distances Between Same Letters](https://leetcode.com/problems/check-distances-between-same-letters/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2399.java) || Medium ||
1516
| 2395 |[Find Subarrays With Equal Sum](https://leetcode.com/problems/find-subarrays-with-equal-sum/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2395.java) || Easy ||
1617
| 2380 |[Time Needed to Rearrange a Binary String](https://leetcode.com/problems/time-needed-to-rearrange-a-binary-string/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2380.java) || Medium ||
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2455 {
4+
public static class Solution1 {
5+
public int averageValue(int[] nums) {
6+
Long sum = 0l;
7+
int count = 0;
8+
for (int num : nums) {
9+
if (num % 3 == 0 && num % 2 == 0) {
10+
sum += num;
11+
count++;
12+
}
13+
}
14+
return count != 0 ? (int) (sum / count) : 0;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)