Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5773d5a

Browse files
refactor 1456
1 parentd53c989 commit5773d5a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎src/main/java/com/fishercoder/solutions/_1456.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packagecom.fishercoder.solutions;
22

3+
importjava.util.Arrays;
34
importjava.util.HashMap;
45
importjava.util.HashSet;
56
importjava.util.Map;
@@ -9,12 +10,7 @@ public class _1456 {
910
publicstaticclassSolution1 {
1011
publicintmaxVowels(Strings,intk) {
1112
Map<Character,Integer>vowels =newHashMap<>();
12-
Set<Character>set =newHashSet<>();
13-
set.add('a');
14-
set.add('e');
15-
set.add('i');
16-
set.add('o');
17-
set.add('u');
13+
Set<Character>set =newHashSet<>(Arrays.asList('a','e','i','o','u'));
1814
intleft =0;
1915
for (;left <k;left++) {
2016
if (set.contains(s.charAt(left))) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp