Skip to content

Commit

Permalink
[PGS] 숫자 문자열과 영단어 / Level1 / 20분
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyoon0701 authored Mar 2, 2023
1 parent 0a24254 commit 8be5d71
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jiyoon0701/[PGS]81301.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution {
public int solution(String s) {
int answer = 0;
String[] number = {"zero","one", "two", "three","four","five","six","seven","eight","nine"};
for (int i = 0; i<=9; i++) {
s = s.replace(number[i], String.valueOf(i));
}
answer = Integer.parseInt(s);
return answer;
}
}

0 comments on commit 8be5d71

Please sign in to comment.