프로그래머스

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 가까운 1 찾기

문제 코드 #include #include using namespace std; int solution(vector arr, int idx) { int answer = -1; if (arr[idx] == 1) { return idx; } else { for (int i = 0; i idx) { return i; } } } return answer; }

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 카운트 다운

문제 코드 vector solution(int start, int end_num) { vector answer; for (int i = start; i >= end_num; --i) { answer.emplace_back(i); } return answer; }

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 글자 지우기

문제 코드 #include using namespace std; string solution(string my_string, vector indices) { string answer = my_string; sort(indices.begin(),indices.end(),greater()); int prev = 0; for(int n : indices) { answer.erase(n,1); } return answer; } https://8156217.tistory.com/7 C++ Sort greater()

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 배열 만들기 1

문제 코드 #include using namespace std; vector solution(int n, int k) { vector answer; for(int i = 1; i

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 문자 개수 세기

문제 코드 #include using namespace std; vector solution(string my_string) { vector answer(52,0); for(const char c : my_string) { if((int)c = (int)'a') { answer[(int)(c-71)]++; } } return answer; }

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 qr code

문제 코드 #include using namespace std; string solution(int q, int r, string code) { string answer = ""; for(int i = 0; i

mane
'프로그래머스' 태그의 글 목록 (9 Page)