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

Commit 41bead2

Browse files
add 2496
1 parent 2d95382 commit 41bead2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------|-------------
11+
| 2496 |[Maximum Value of a String in an Array](https://leetcode.com/problems/maximum-value-of-a-string-in-an-array/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2496.java) || Easy ||
1112
| 2467 |[Convert the Temperature](https://leetcode.com/problems/convert-the-temperature/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2469.java) || Easy ||
1213
| 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 ||
1314
| 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 ||
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _2496 {
4+
public static class Solution1 {
5+
public int maximumValue(String[] strs) {
6+
int max = 0;
7+
for (String str : strs) {
8+
try {
9+
int num = Integer.parseInt(str);
10+
max = Math.max(max, num);
11+
} catch (Exception e) {
12+
max = Math.max(max, str.length());
13+
}
14+
}
15+
return max;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)