728x90
반응형
SMALL
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> array) {
vector<int> answer = {0,0};
for(int i=0; i<array.size();i++)
answer = (array[i] > answer[0]) ? vector<int>{array[i],i}:answer;
return answer;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
| [프로그래머스] 문자열 정렬하기 (2) (0) | 2025.09.06 |
|---|---|
| [프로그래머스] 약수 구하기 (0) | 2025.09.06 |
| [프로그래머스] 인덱스 바꾸기 (0) | 2025.09.05 |
| [프로그래머스] 대문자와 소문자 (0) | 2025.09.05 |
| [프로그래머스] 암호 해독 (0) | 2025.09.05 |
댓글