일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- MATLAB
- C++
- omscs
- 방통대
- 머신러닝
- 마니토바
- mpnp
- 선형대수
- cpp
- LV1
- Deep learning
- 캐나다 영주권
- leetcode
- zeros
- Plotting
- 조지아텍
- LAA
- 코딩테스트
- machine learning
- 매트랩
- 개발자
- 방송통신대학교
- 딥러닝
- 알고리즘
- 기본
- 주정부이민
- 컴퓨터과학과
- 프로그래머스
- 온라인석사
- EOI
Archives
- Today
- Total
Byte by Byte
804. Unique Morse Code Words.cpp 본문
class Solution {
public:
int uniqueMorseRepresentations(vector<string>& words) {
vector<string>code ={".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
set<string>s;
for(int i =0; i<words.size();i++){
string tmp="";
for(int j =0; j<words[i].size();j++){
tmp += code[words[i][j]-'a'];
}
s.insert(tmp);
}
return s.size();
}
};
'개발 로그 > 알고리즘' 카테고리의 다른 글
1817. Finding the Users Active Minutes.cpp (0) | 2021.09.30 |
---|---|
797. All Paths From Source to Target.cpp (0) | 2021.09.30 |
1551. Minimum Operations to Make Array Equal.cpp (0) | 2021.09.27 |
1290. Convert Binary Number in a Linked List to Integer.cpp (0) | 2021.09.26 |
1656. Design an Ordered Stream.cpp (0) | 2021.09.26 |