1-17)TIL

최보훈·2024년 1월 17일
0

TIL

목록 보기
11/28
post-thumbnail

string.Substring(int, int)

문자열의 처음 int 부분에서 두번째 int부분까지 자른다.

Enumerable.Zip()

지정된 함수를 두 시퀀스의 해당 요소에 적용하여 결과 시퀀스를 만든다.

public int solution(int[] a, int[] b)
{
    int answer = 0;
    answer = a.Zip(b,(n,m)=>n*m).Sum();
    return answer;
}

두 배열의 같은index의 곲의 합을구하는=내적 함수이다.

0개의 댓글