728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181829
📝 나의 풀이
using System;
public class Solution {
public int solution(int[,] board, int k) {
int answer = 0;
for(int i=0; i<board.GetLength(0); i++){
for(int j=0; j<board.GetLength(1); j++){
if(i+j<=k){
answer += board[i,j];
}
}
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 주사위 게임 2 (0) | 2023.09.24 |
---|---|
[프로그래머스 | C# | Lv.0] 콜라츠 수열 만들기 (1) | 2023.09.24 |
[프로그래머스 | C# | Lv.0] 커피 심부름 (0) | 2023.09.24 |
[프로그래머스 | C# | Lv.0] 두 수의 연산값 비교하기 (0) | 2023.09.21 |
[프로그래머스 | C# | Lv.0] 날짜 비교하기 (0) | 2023.09.21 |