Kotlinlearncs.online LogoJava
Return to List

Solve: Sum Limit

Imported By: Geoffrey Challen
/ Version: 2021.6.0

Given 2 non-negative Ints, return their sum, so long as the sum has the same number of digits as the first int. If the sum has more digits, just return the value of first Int. You may want to convert the Int values to Strings to determine their length.

fun sumLimit(
first: Int,
second: Int,
): Int {
return 0 // You may need to remove this starter code

Related Lessons

Stuck? You may find these lessons helpful: