Skip to content

Instantly share code, notes, and snippets.

@JunJaBoy
Created April 26, 2024 03:48
Show Gist options
  • Save JunJaBoy/f65eb08b44b91b0863e6e0bf726f68b6 to your computer and use it in GitHub Desktop.
Save JunJaBoy/f65eb08b44b91b0863e6e0bf726f68b6 to your computer and use it in GitHub Desktop.
HackerRank/Algorithm/MergeTwoSortedLinkedLists kotlin
fun main(args: Array<String>) {
repeat(readln().trim().toInt()) {
val result = mutableListOf<Int>()
repeat(readln().trimEnd().toInt()) {
result.add(readln().toInt())
}
repeat(readln().trimEnd().toInt()) {
result.add(readln().toInt())
}
result.sorted().forEach { print("$it ") }
println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment