nkiesel / AdventOfCode2021

Koltin solutions for the 2021 edition of AoC
0 stars 0 forks source link

Could use "split" w/o regex #1

Closed nkiesel closed 2 years ago

nkiesel commented 2 years ago

https://github.com/nkiesel/AdventOfCode2021/blob/dadc1e8e0acfc88382a52c363f1bfc3a4022a785/src/test/kotlin/Day02.kt#L39

(Just trying out how to comment on code in github....)

You could use s.split(" ") instead of s.split(" ".toRegex()) (Kotlin has overloaded split for String and Regex argument)

prasad-babu commented 2 years ago

updated using split(" ")