2022-12-17 04:45:04 +09:00
|
|
|
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/81301
|
2022-12-17 04:42:05 +09:00
|
|
|
|
|
|
|
|
class Solution {
|
|
|
|
|
public int solution(String s) {
|
|
|
|
|
String[] sa = {"zero","one","two","three","four","five","six","seven","eight","nine"};
|
|
|
|
|
for(int a = 0; a < 10; a++){
|
2022-12-17 04:45:04 +09:00
|
|
|
s = s.replaceAll(sa[a],a+"");
|
2022-12-17 04:42:05 +09:00
|
|
|
}
|
|
|
|
|
return Integer.valueOf(s);
|
|
|
|
|
}
|
|
|
|
|
}
|