Skip to content

Commit 017c115

Browse files
committed
if/then/else fix
1 parent 397d45c commit 017c115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/Day02.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ object Day02:
4242
case _ :: tail => ls.zip(tail).forall((l, r) => l.differsFrom(min = 1, max = 3)(r))
4343

4444
def safety(ls: List[Level]): Safety =
45-
if ((isAllIncreasing(ls) || isAllDecreasing(ls)) && areAllDeltasBetween1And3(ls)) Safe else Unsafe
45+
if (isAllIncreasing(ls) || isAllDecreasing(ls)) && areAllDeltasBetween1And3(ls) then Safe else Unsafe
4646

4747
extension [A](nel: NonEmptyList[A])
4848
def removed(elementAt: Int): List[A] =
4949
val as = nel.toList
50-
if (elementAt < 0 || nel.length <= elementAt) as
50+
if elementAt < 0 || nel.length <= elementAt then as
5151
else // 0 <= idx && idx < nel.length
5252
as.take(elementAt) ++ as.drop(1 + elementAt)
5353

0 commit comments

Comments
 (0)