알고리즘 코드카타
Not Boring Movies
select *
from Cinema
where id % 2 = 1
and description != 'boring'
order by rating desc
;
옹알이(2)
class Solution {
public int solution(String[] babbling) {
int answer = 0;
String[] pron = {"aya", "ye", "woo", "ma"};
int j = 1;
for (String word : babbling){
boolean cando = false;
StringBuilder sb = new StringBuilder(word);
for (int i = 0; i <= 3; i++) {
int findIndex = sb.indexOf(pron[i]);
if (findIndex != -1) {
sb.replace(findIndex, findIndex + pron[i].length(), " ");
if (sb.toString().contains(pron[i]) && sb.indexOf(pron[i]) != findIndex+1){
i--;
}
if (sb.toString().replace(" ", "").length() == 0){
cando = true;
break;
}
}
}
if (cando){
answer++;
}
}
return answer;
}
}