레벨1짜린데 ㅇㅅㅇ


#include <string>

#include <vector>

#include <bits/stdc++.h>


using namespace std;


int solution(string s) {

    int answer = 0;

    char ans[100];

    int ed=0;

    

    string num_str+ = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};

    

    // for(int i=0; i<s.size(); i++)

    int i=0;

    while(i<s.size())

    {

        if(s[i]>= 'a' && s[i] <= 'z')

        {

            for(int j=0; j<10; j++)

            {

                if(s.substr(i,3) == num_str[j] || s.substr(i,4) == num_str[j] || s.substr(i,5)== num_str[j])

                {

                    i+= (num_str[j].size());

                    ans[ed++] = (j+'0');

                    break;

                }

            }

            

        }

        else

        {

            ans[ed++] = s[i];

            i++;

        }

    }

    for(int i=0; i<ed; i++)

    {

        answer += ((int) pow(10,i) * (ans[ed-1-i]-'0'));

    }

    return answer;

}


https://programmers.co.kr/learn/courses/30/lessons/81301?language=cpp