[Kotlin] 음양 더하기 // 두 정수 사이의 합
class Solution { fun solution(absolutes: IntArray, signs: BooleanArray): Int { for ((index,sign) in signs.withIndex()){ if(sign) absolutes[index] = absolutes[index] else absolutes[index] = - absolutes[index] } var answer: Int = absolutes.sum() return answer } } 좋아 class Solution { fun solution(a: Int, b: Int): Long { var answer: Long = 0 if (a
프로그래밍
2021. 4. 18. 17:25