Skip to content

Commit db111c3

Browse files
committed
26.04.15
1 parent f57325e commit db111c3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package baekjoon.bronze.b3
2+
3+
fun main() {
4+
val n = readln().toInt()
5+
val from = readln()
6+
val to = readln()
7+
8+
var answer = 0
9+
10+
for (i in 0 until n) {
11+
val diff = kotlin.math.abs(from[i] - to[i])
12+
answer += minOf(diff, 26 - diff)
13+
}
14+
15+
println(answer)
16+
}

0 commit comments

Comments
 (0)