-
프로그래머스 - 내적 [자바]Algorithms/- 프로그래머스 2022. 1. 30. 22:37
- 문제 링크 : 내적
정답
class Solution { public int solution(int[] a, int[] b) { int answer = 0; int length = a.length; for(int i=0; i<length; i++){ answer += (a[i] * b[i]); } return answer; } }
분석
- 단순사칙 연산
반응형