TIL

3/18일자 TIL

오딘.L.스트레인지 2026. 3. 18. 20:15

코드카타-바탕화면 정리

#include <string>
#include <vector>
#include <algorithm>
#include<set>
#include<iostream>
using namespace std;

vector<int> solution(vector<string> wallpaper) {
    vector<int> answer;
//시작점: 열 최초,행 최초 끝점: 끝 행, 열 끝
    set<int> x;
    set<int> y;
    for(int i=0;i<wallpaper.size();i++){
        for(int j=0;j<wallpaper[0].size();j++){
            if (wallpaper[i][j]=='#'){
                x.insert(j);
                y.insert(i);
            }
        }
    }
    answer.push_back(*y.begin());
    answer.push_back(*x.begin());
    answer.push_back(*y.rbegin()+1);
    answer.push_back(*x.rbegin()+1);
    
    return answer;
}
 

 

CS 특강

CS는 컴퓨터 사이언스를 뜻하며, 

'TIL' 카테고리의 다른 글

3/20일자 TIL  (0) 2026.03.20
3/19일자 TIL  (0) 2026.03.19
3월 17일자 TIL  (0) 2026.03.17
3/16일자 TIL  (0) 2026.03.16
3월 13일자 TIL  (1) 2026.03.13