tracks/kotlin/exercises/rna-transcription/src/example/kotlin/RnaTranscription.kt in trackler-2.0.6.12 vs tracks/kotlin/exercises/rna-transcription/src/example/kotlin/RnaTranscription.kt in trackler-2.0.6.13
- old
+ new
@@ -1,12 +1,9 @@
-object RnaTranscription {
-
- fun ofDna(strand: String) = strand.map {
- when (it) {
- 'A' -> 'U'
- 'G' -> 'C'
- 'C' -> 'G'
- 'T' -> 'A'
- else -> it
- }
- }.joinToString("")
-}
+fun transcribeToRna(dna: String): String = dna.map { nucleotide ->
+ when (nucleotide) {
+ 'A' -> 'U'
+ 'G' -> 'C'
+ 'C' -> 'G'
+ 'T' -> 'A'
+ else -> nucleotide
+ }
+}.joinToString("")