오늘의 코드카타
k번째 수
using System;
public class Solution {
public int[] solution(int[] array, int[,] commands) {
int[] answer = new int[commands.GetLongLength(0)];
for(int n = 0; n < commands.GetLongLength(0); n++)
{
int i = commands[n,0];
int j = commands[n,1];
int k = commands[n,2];
int[] temp = new int[j - i + 1];
for(int a = 0; a < temp.Length; a++)
{
temp[a] = array[a+i-1];
}
Array.Sort(temp);
answer[n] = temp[k-1];
}
return answer;
}
}
시작하는 i번 끝번 j 로 temp배열을 만들고 배열 검색후 나온 k를 다시 배열 answer로 만들었다
오늘의 팀프로젝트
어제에 이어서 기획과 와이어 프레임을 완성시켰다.
기간이 길게 주어졌지만 절대 나태해질 시간이 없다는건 지금까지의 경험으로 알고 있다.
로직과 기본기능을 만들고 나면 대부분 반복작업의 영역이 될 것 같은데 완성도 높게 만들고 싶다
'TIL' 카테고리의 다른 글
TIL 24-03-11 (0) | 2024.03.11 |
---|---|
TIL 24-03-08 (0) | 2024.03.08 |
TIL 24-03-06 (0) | 2024.03.06 |
TIL 24-024-27 (0) | 2024.02.27 |
TIL 24-02-26 (0) | 2024.02.26 |