-
-
Save ardakazanci/135e81df09d47c8d8efb5581b984f140 to your computer and use it in GitHub Desktop.
Kata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
var firstList = listOf<Int>(1, 2, 3, 4, 5) | |
var secondList = listOf<Int>(5, 4, 3, 2, 7) | |
var firstListString = "" | |
var secondListString = "" | |
var result: String? = null | |
var resultList = arrayListOf<String>() | |
for (i in (firstList.size - 1) downTo 0) { | |
firstListString += firstList[i].toString() | |
secondListString += secondList[i].toString() | |
} | |
println(firstListString) // reverse | |
println(secondListString) // reverse | |
println((firstListString.toInt()) + (secondListString.toInt())) // Sum | |
result = ((firstListString.toInt()) + secondListString.toInt()).toString() | |
for (i in (result.length - 1) downTo 0) { | |
print(result[i] + "->") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment