class Solution {
public String[] solution(String[] strArr) {
String[] answer = {};
return answer;
}
}
import java.util.ArrayList;
class Solution {
public String[] solution(String[] strArr) {
ArrayList <String> list = new ArrayList();
for (int i = 0; i < strArr.length; i++) {
if(!strArr[i].contains("ad")) {
list.add(strArr[i]);
}
}
String[] answer = new String[list.size()]; // string 타입으로 배열 생성
for (int i = 0; i < list.size(); i++) {
answer[i] = list.get(i);
}
return answer;
}
}