diff options
| author | Andreas Vögele <andreas@andreasvoegele.com> | 2023-08-01 17:40:40 +0200 |
|---|---|---|
| committer | Andreas Vögele <andreas@andreasvoegele.com> | 2023-08-01 17:47:14 +0200 |
| commit | 789fd5f8c7253c1a487a6413e4d9bc46a700a3d2 (patch) | |
| tree | ad5e8e396b62b7e14ab17c3ec9e1ff541f240dac | |
| parent | 59c335be6f85948114dc7e090d1df6fb76b3a62c (diff) | |
| download | perlweeklychallenge-club-789fd5f8c7253c1a487a6413e4d9bc46a700a3d2.tar.gz perlweeklychallenge-club-789fd5f8c7253c1a487a6413e4d9bc46a700a3d2.tar.bz2 perlweeklychallenge-club-789fd5f8c7253c1a487a6413e4d9bc46a700a3d2.zip | |
Make ktlint happy
| -rwxr-xr-x | challenge-221/andreas-voegele/kotlin/ch-2.kts | 2 | ||||
| -rwxr-xr-x | challenge-223/andreas-voegele/kotlin/ch-1.kts | 6 | ||||
| -rwxr-xr-x | challenge-224/andreas-voegele/kotlin/ch-2.kts | 9 | ||||
| -rwxr-xr-x | challenge-225/andreas-voegele/kotlin/ch-1.kts | 8 |
4 files changed, 12 insertions, 13 deletions
diff --git a/challenge-221/andreas-voegele/kotlin/ch-2.kts b/challenge-221/andreas-voegele/kotlin/ch-2.kts index 04f42e7cd6..413caa100e 100755 --- a/challenge-221/andreas-voegele/kotlin/ch-2.kts +++ b/challenge-221/andreas-voegele/kotlin/ch-2.kts @@ -15,7 +15,7 @@ fun nextNumbers(acc: MutableList<Int>, distance: Int, ints: Ints): Ints { var a = acc.last() for (b in ints) { if (Math.abs(a - b) == distance) { - acc.add(b); + acc.add(b) a = b } } diff --git a/challenge-223/andreas-voegele/kotlin/ch-1.kts b/challenge-223/andreas-voegele/kotlin/ch-1.kts index 8775bbc91e..f1235a1ba2 100755 --- a/challenge-223/andreas-voegele/kotlin/ch-1.kts +++ b/challenge-223/andreas-voegele/kotlin/ch-1.kts @@ -11,6 +11,6 @@ fun isPrime(n: Long) = fun primeNumbers(n: Long): List<Long> = (2..n).filter { isPrime(it) } -println(primeNumbers(10L).size); -println(primeNumbers(1L).size); -println(primeNumbers(20L).size); +println(primeNumbers(10L).size) +println(primeNumbers(1L).size) +println(primeNumbers(20L).size) diff --git a/challenge-224/andreas-voegele/kotlin/ch-2.kts b/challenge-224/andreas-voegele/kotlin/ch-2.kts index da2245a498..2c2d97f194 100755 --- a/challenge-224/andreas-voegele/kotlin/ch-2.kts +++ b/challenge-224/andreas-voegele/kotlin/ch-2.kts @@ -16,8 +16,7 @@ fun combineDigits(numericString: String): List<List<Int>> = val rest = numericString.drop(n) if (rest.isEmpty()) { listOf(listOf(number)) - } - else { + } else { combineDigits(rest).map { listOf(number) + it } } } @@ -38,6 +37,6 @@ fun isAdditive(numbers: List<Int>): Boolean { fun isAdditiveNumber(numericString: String) = combineDigits(numericString).any { isAdditive(it) } -println(isAdditiveNumber("112358")); -println(isAdditiveNumber("12345")); -println(isAdditiveNumber("199100199")); +println(isAdditiveNumber("112358")) +println(isAdditiveNumber("12345")) +println(isAdditiveNumber("199100199")) diff --git a/challenge-225/andreas-voegele/kotlin/ch-1.kts b/challenge-225/andreas-voegele/kotlin/ch-1.kts index 8f99122e31..6eb1f57d97 100755 --- a/challenge-225/andreas-voegele/kotlin/ch-1.kts +++ b/challenge-225/andreas-voegele/kotlin/ch-1.kts @@ -14,14 +14,14 @@ println( maxWords( "Perl and Raku belong to the same family.", "I love Perl.", - "The Perl and Raku Conference." - ) + "The Perl and Raku Conference.", + ), ) println( maxWords( "The Weekly Challenge.", "Kotlin is the most interesting guest language.", - "Team PWC has over 300 members." - ) + "Team PWC has over 300 members.", + ), ) |
