My goal is to combine an array of strings (apple,banana,orange) and an array of ints (4,1,3), then find the smallest int in that 2D array 1, and finally print the matching string to it banana. I tried using minOf and Arrays.deepToString , but they didn´t work together how I intended. If someone knows a better way maybe with pairs (I don´t know a lot about that), any help is appreciated!
fun main(){
var fruits = arrayOf("apple","banana","orange")
var ratings = intArrayOf(4,1,3)
var combined = arrayOf(fruits, ratings)
//did not work
println(minOf(Arrays.deepToString(combined)))
}