일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |
- 머신러닝
- 선형대수
- mpnp
- Deep learning
- 조지아텍
- zeros
- 기본
- 캐나다 영주권
- 딥러닝
- 온라인석사
- machine learning
- LV1
- 프로그래머스
- omscs
- C++
- MATLAB
- 코딩테스트
- cpp
- 알고리즘
- 방송통신대학교
- Plotting
- leetcode
- 방통대
- 매트랩
- 위니펙
- LAA
- 주정부이민
- EOI
- 개발자
- 컴퓨터과학과
- Today
- Total
목록cpp (12)
Byte by Byte

class Solution { public: int uniqueMorseRepresentations(vector& words) { vectorcode ={".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."}; sets; for(int i =0; i

class OrderedStream { public: vectoros; int x; int idx =0; OrderedStream(int n) { vector temp(n); os = temp; x = n; } vector insert(int idKey, string value) { vectorres; os[idKey-1] = value; for(; idxinsert(idKey,value); */

class Solution { public: string truncateSentence(string s, int k) { string ans = ""; for(int i =0; i

point : string integer 변환 할 수 있는지 #include #include #include #include using namespace std; string solution(string s) { string tmp = ""; vectorv; for(int i =0; i < s.size(); i++){ if(s[i]!=' ') tmp += s[i]; else if (s[i] == ' ') { v.push_back(stoi(tmp)); tmp = ""; } if(i == s.size()-1) v.push_back(stoi(tmp)); } sort(v.begin(),v.end()); string x = to_string(v[0]) + " " + to_string(v[v.size()-1]); ..

string이 vector와 유사함을 착안. bool compare (string a, string b) { return a[i] == b[i] ? a < b : a[i] < b[i]; } vector solution(vector strings, int n) { i = n; sort (strings.begin(), strings.end(), compare); return strings; }

나의 방식 1. 10진수의 arr1 arr2에 대해, 각각 2진수로 바꿈. 2. 각각의 2진수를 비교하여, 비밀지도 합본 완성. 3. string변환 배운것 (컴퓨터는 10진수를 2진수로 읽음에 착안. 출제자의 의도.) 1. arr1 arr2 OR 비트 연산을 통해, 비밀지도 합본 완성 2. string변환 #include #include using namespace std; vector toBinary(int x, int k){ vector v; for(int i=0; i

#include #include #include using namespace std; bool solution(string s) { bool answer = true; int count =0; for(int i =0; i

핵심 : 주어진 조건을 꼼꼼히 확인하는가. 문제 제목은 문자열 다루기 이지만, 개인적으로 이 문제는 주어진 조건을 sensitive 하게 생각하는지를 묻는 문제이다. string size가 4또는6인지에 대한 조건은 생각안하고 넘어가기 쉽기 때문이다. isdigit, isnumber 쓰려면 #include #include #include using namespace std; bool solution(string s) { bool answer = false; if(s.size()==4 || s.size()==6) answer = true; for(int i =0; i