You are viewing a single comment's thread. Return to all comments →
Kotlin:
fun getMoneySpent(keyboards: Array<Int>, drives: Array<Int>, b: Int): Int { var max=0 for(k in 0 until keyboards.size){ for(d in 0 until drives.size){ var sum=keyboards[k]+drives[d] if(sum>max && b>=sum){ max=sum } } } return if(max==0) -1 else max }
Seems like cookies are disabled on this browser, please enable them to open this website
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
Kotlin: