#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool solution(vector<string> phone_book)
{
bool answer = true;
sort(phone_book.begin(), phone_book.end());
for(int i = 0; i < phone_book.size() - 1; i++)
{
if (phone_book[i] == phone_book[i+1].substr(0, phone_book[i].size()))
{
return false;
}
}
return answer;
}
'Daily Coding Challenge > Lv2' 카테고리의 다른 글
주식가 (0) | 2020.11.24 |
---|---|
프린터 (0) | 2020.11.24 |
타겟 넘버 (0) | 2020.11.24 |