We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 397d45c commit 017c115Copy full SHA for 017c115
src/main/scala/Day02.scala
@@ -42,12 +42,12 @@ object Day02:
42
case _ :: tail => ls.zip(tail).forall((l, r) => l.differsFrom(min = 1, max = 3)(r))
43
44
def safety(ls: List[Level]): Safety =
45
- if ((isAllIncreasing(ls) || isAllDecreasing(ls)) && areAllDeltasBetween1And3(ls)) Safe else Unsafe
+ if (isAllIncreasing(ls) || isAllDecreasing(ls)) && areAllDeltasBetween1And3(ls) then Safe else Unsafe
46
47
extension [A](nel: NonEmptyList[A])
48
def removed(elementAt: Int): List[A] =
49
val as = nel.toList
50
- if (elementAt < 0 || nel.length <= elementAt) as
+ if elementAt < 0 || nel.length <= elementAt then as
51
else // 0 <= idx && idx < nel.length
52
as.take(elementAt) ++ as.drop(1 + elementAt)
53
0 commit comments