The Empire strikes back

Report a typo

The Resistance is organizing ships to confront the Empire. R2D2 has a list with two ships. R2D2 will overload "+" to return the sum of all the ammunition of the two ships.

println(listOfShip[0] + listOfShip[1])

Sample Input 1:

Bismarck-200 Titanic-340

Sample Output 1:

540
Write a program in Kotlin
// define the function
/*?*/(other: Ship): Int {
// and write your code here
}
___

Create a free account to access the full topic