Skip to content

Commit 08ff6b5

Browse files
committed
fix: 🐛 format task3 streams
1 parent ebfaad9 commit 08ff6b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/largest_prime_factor/simple_stream.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule LargestPrimeFactor.SimpleStream do
77
Stream.iterate(2, &(&1 + 1))
88
|> Stream.filter(&(rem(n, &1) == 0))
99
|> Stream.filter(&prime?/1)
10-
|> Enum.take(1)
11-
|> List.first()
10+
|> Stream.filter(&(&1 < (prime?(n) && n || ceil(:math.sqrt(n)))))
11+
|> Enum.max()
1212
end
1313
end

0 commit comments

Comments
 (0)