조앤의 기술블로그

[프로그래머스] 내적(java) 본문

Programming/프로그래머스

[프로그래머스] 내적(java)

쬬앤 2021. 6. 27. 18:44
class Solution {
    public int solution(int[] a, int[] b) {
        int answer = 0;
        
        for(int i = 0; i < a.length; i++){
            answer += a[i] * b[i];
        }
        
        return answer;
    }
}