내 답안
class Solution {
public int solution(String my_string, String is_suffix) {
int answer = 0;
if(my_string.endsWith(is_suffix)){
answer = 1;
}
return answer;
}
}
Java
복사
다른사람 풀이
class Solution {
public int solution(String my_string, String is_suffix) {
int answer = 0;
for(int i=0;i<my_string.length();i++){
if(is_suffix.equals(my_string.substring(i))){
answer = 1;
break;
}
}
return answer;
}
}
Java
복사