Problem 11
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package ninetyNineScalaProblems
|
||||
|
||||
import scala.compiletime.ops.boolean
|
||||
|
||||
class Problem11Suite extends munit.FunSuite:
|
||||
List(
|
||||
(List(1, 2, 3, 4), List(1, 2, 3, 4)),
|
||||
(List(1, 2, 2, 3), List(1, (2, 2), 3)),
|
||||
(List(1, 2, 3, 2), List(1, 2, 3, 2)),
|
||||
(List(), List()),
|
||||
(List(1), List(1)),
|
||||
(List(1, 1), List((2, 1))),
|
||||
(List(1, 1, 1, 1, 2, 3, 3, 1, 1, 4, 5, 5, 5, 5), List((4, 1), 2, (2, 3), (2, 1), 4, (4, 5)))
|
||||
).foreach:
|
||||
case (list, expected) =>
|
||||
test(s"modifiedRunLengthEncode returns [$expected]"):
|
||||
assertEquals(Problem11.modifiedRunLengthEncode(list), expected)
|
||||
Reference in New Issue
Block a user