hello there, i may have this kind of code ```fun m...
# announcements
a
hello there, i may have this kind of code
Copy code
fun main(){
  val list =  listOf(1, 10,-1, -2, 3,12)
  val joined = list.joinToString(" + ")
  println("${joined} = 10")
}
which prints the list as string with + sine added(
"1 + 10 + -1 + -2 + 3 + 12 = 10"
). but i wan't it to really add and return either true or false. how can i do that
m
Copy code
val list =  listOf(1, 10,-1, -2, 3,12)
val sum = list.sum()
println("${sum == 10}")
v
Copy code
fun main(){
  val list =  listOf(1, 10,-1, -2, 3,12)
  val joined = list.joinToString(" + ")
  println("${joined} = 10 => ${list.sum() == 10}")
}
a
ok thank you verry much