Created
April 26, 2024 03:48
-
-
Save JunJaBoy/f65eb08b44b91b0863e6e0bf726f68b6 to your computer and use it in GitHub Desktop.
HackerRank/Algorithm/MergeTwoSortedLinkedLists kotlin
This file contains hidden or 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(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