Skip to content

Commit

Permalink
이슈 #324에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 19, 2024
1 parent e899cba commit 14bce79
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Programmers/가장_큰_수_찾기.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <string>
#include <vector>
#include <queue>

using namespace std;

vector<int> solution(vector<int> array) {
priority_queue<pair<int, int>> pq;

for (int i = 0; i < array.size(); i++) {
pq.push({array[i], i});
}

return {pq.top().first, pq.top().second};
}

0 comments on commit 14bce79

Please sign in to comment.