#[Kotlin] Transpose - An error occurred while running your tests
6 messages · Page 1 of 1 (latest)
The test won't run or it take a long time to run and time out?? Those are 2 different things
Since you mention infinite loop, I would hazaard a guess that it is second case.
Regardless, please give more info :
- if the test doesnt run, what kinda of error was given out
- post your code here so people can take a look. remember to use codeblock and not screenshot
There error I got
With this code:
object Transpose {
fun transpose(input: List<String>): List<String> {
val longestLength = input.map { it.length }.max()
return List(longestLength) { index ->
input
.map { it.padEnd(longestLength) }
.map { it[index] }
.joinToString(separator = "")
}.map { it.trimEnd() }
}
}
did it run in your local env?