본문 바로가기
반응형

Swift66

[프로그래머스 - 스택/큐] 기능개발 카테고리 (Category) 작성 날짜 (Write Date) 최근 수정 날자 (Recent Write Date) 작성자 (Writer) Algorithm 2019.04.08. 20:06 2021.04.10. 17:59:14 Dev.Yang [문제 설명] 프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다. 각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다. 또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 기능보다 먼저 개발될 수 있고, 이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다. 먼저 배포되어야 하는 순서대로 작업의 진도가 적힌 정수 배열 progresses와 각 작업의 개발 속도가 적힌 정수 배열 speeds가 주어질 때 각 배포마다 몇.. 2019. 4. 8.
[프로그래머스 - 완전탐색] 숫자 야구 📄 [완전탐색] 숫자 야구 C++ Source Code #include #include #include #include using namespace std; #define INT_PAIR pair #define CUS_PAIR pair #define START 123 #define END 987 const bool findDigit(const INT_PAIR condition, const string target, const string match) { INT_PAIR conds = make_pair(0, 0); for (int ii = 0; ii < target.size(); ii++) { for (int jj = 0; jj < match.size(); jj++) { // Case Find Strike.. 2019. 4. 5.
[프로그래머스 - 정렬] K번째수 📄 [정렬] K번째수 C++ Source Code #include #include #include using namespace std; const int findTarget(const vector & arr, const int left, const int right, const int target) { vector bucket = vector(arr.begin() + left, arr.begin() + right); std::sort(bucket.begin(), bucket.end()); return bucket[target]; } vector solution(vector array, vector commands) { vector answer; for (const auto command : command.. 2019. 4. 5.
[프로그래머스 - 정렬] H-Index 📄 [정렬] H-Index Swift Source Code import Foundation // MARK: - https://en.wikipedia.org/wiki/H-index func solution(_ citations:[Int]) -> Int { let length = citations.count // MARK: - First we order the values of f from the largest to the lowest value. (DESC - 오름차순) let paper = citations.sorted { $0 > $1 } // MARK: - we look for the last position in which f is greater than or equal to the position.. 2019. 4. 5.
반응형