Problem 19

This commit is contained in:
2026-03-19 15:39:36 +01:00
parent 4cb7b4e95b
commit 547797801c
2 changed files with 28 additions and 0 deletions
@@ -0,0 +1,17 @@
package ninetyNineScalaProblems
import scala.compiletime.ops.boolean
class Problem19Suite extends munit.FunSuite:
List(
((0, List(1, 2, 3, 4)), List(1, 2, 3, 4)),
((1, List(1, 2, 3, 4)), List(2, 3, 4, 1)),
((1, List(1)), List(1)),
((0, List(1)), List(1)),
((1, List()), List()),
((0, List()), List()),
((-1, List(1, 2, 3, 4)), List(4, 1, 2, 3)),
).foreach:
case ((n, list), expected) =>
test(s"rotateLeft returns [$expected]"):
assertEquals(Problem19.rotateLeft(n, list), expected)