#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> wallpaper) {
// min_x, min_y, max_x, max_y
vector<int> answer = {52,52,-1,-1};
int x = 0;
for(auto paper : wallpaper) {
int y = 0;
for(auto ch : paper) {
if(ch == '#') {
answer.at(0) = min(x, answer.at(0));
answer.at(1) = min(y, answer.at(1));
answer.at(2) = max(x+1, answer.at(2));
answer.at(3) = max(y+1, answer.at(3));
}
y++;
}
x++;
}
return answer;
}'프로그래머스 > Level1' 카테고리의 다른 글
| [Level1] 덧칠하기 (C++/Python) (0) | 2023.05.05 |
|---|---|
| [Level1] 공원 산책 (C++) (0) | 2023.05.04 |
| [Level1] 달리기 경주 (C++) (0) | 2023.04.26 |
| [Level1] 삼총사 (C++/Python) (0) | 2023.04.25 |
| [Level1] 3진법 뒤집기 (C++/Python) (0) | 2023.04.24 |