#70128
๐ Question ?
https://school.programmers.co.kr/learn/courses/30/lessons/70128
class Solution {
fun solution(a: IntArray, b: IntArray): Int {
var answer: Int = 1234567890
return answer
}
}
๐งฉ Thought Process
- ์ธ๋ฑ์ค๊ฐ ๊ฐ์ ๋ ๋ฐฐ์ด์ ๊ณฑํ ์๋ก์ด ๋ฐฐ์ด ๋ง๋ค๊ธฐ
- ์๋ก ๋ง๋ค ๋ฐฐ์ด์ sum() ๊ตฌํ๊ธฐ
๐ Answer
class Solution {
fun solution(a: IntArray, b: IntArray): Int {
var answer = 0
for (i in 0 until a.size) {
answer += a[i]*b[i]
}
return answer
}
}
๐ Result
๐ Comment
๋ฟ ! ์์ท์ํฌ~