https://programmers.co.kr/learn/courses/30/lessons/81301
Code
1
2
3
4
def solution(s):
for num, name in enumerate(['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']):
s = s.replace(name, str(num))
return int(s)
Complexity
$O(|s|)$
PREVIOUSEtc