Solución
solution.tsTypeScript
public class Solution {
public boolean endsWithSuffix(String str, String suffix) {
if(suffix.isEmpty()) return true;
if(str.isEmpty()) {
return true;
} else if (suffix.length() > str.length()) {
return false;
}
for(int i = 0; i < suffix.length(); i++) {
char sufijo = suffix.charAt(i);
char comparacion = str.charAt(str.length() - suffix.length() + i);
if(sufijo == comparacion) {
return true;
}
}
return false;
}
}0respuestas