質問編集履歴
4
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,23 +42,25 @@
|
|
42
42
|
|
43
43
|
|
44
44
|
|
45
|
-
for (int i = 0; i <
|
45
|
+
for (int i = 0; i < targetList.size(); i++) {
|
46
46
|
|
47
|
-
for(int j = 0; j <
|
47
|
+
for(int j = 0; j < targetList.size(); j++) {
|
48
48
|
|
49
|
-
if (
|
49
|
+
if (targetList.get(i) == targetList.get(j)) {
|
50
50
|
|
51
51
|
count++;
|
52
52
|
|
53
53
|
}
|
54
54
|
|
55
|
-
if(count
|
55
|
+
if(count>=2){
|
56
56
|
|
57
|
-
unique.re
|
57
|
+
unique.add(targetList.get(i));
|
58
58
|
|
59
59
|
}
|
60
60
|
|
61
61
|
}
|
62
|
+
|
63
|
+
count = 0;
|
62
64
|
|
63
65
|
}
|
64
66
|
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,8 +72,6 @@
|
|
72
72
|
|
73
73
|
UniqueString us = new UniqueString();
|
74
74
|
|
75
|
-
//この下の文字が表示されない
|
76
|
-
|
77
75
|
List<String> unique = us.getUniqueList(Arrays.asList("a","b","c","b","c"));
|
78
76
|
|
79
77
|
|
2
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,6 +72,8 @@
|
|
72
72
|
|
73
73
|
UniqueString us = new UniqueString();
|
74
74
|
|
75
|
+
//この下の文字が表示されない
|
76
|
+
|
75
77
|
List<String> unique = us.getUniqueList(Arrays.asList("a","b","c","b","c"));
|
76
78
|
|
77
79
|
|
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,9 +28,9 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
-
public class UniqueString
|
31
|
+
public class UniqueString {
|
32
32
|
|
33
|
-
|
33
|
+
|
34
34
|
|
35
35
|
public List<String> getUniqueList(List<String> targetList) {
|
36
36
|
|