1
class Solution {
2
public List<String> stringMatching(String[] words) {
3
List<String> ans = new ArrayList<>();
4
for (int i = 0; i < words.length; i++) {
5
String s = words[i];
6
for (int j = 0; j < words.length; j++) {
7
if (i == j) {
8
continue;
9
}
10
if (words[j].indexOf(s) >= 0) {
11
ans.add(s);
12
break;
13
}
14
}
15
}
16
return ans;
17
}
18
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0