-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solution1.6.2.3 added #50
Conversation
Signed-off-by: Andreas Roehler <[email protected]>
Signed-off-by: Andreas Roehler <[email protected]>
Signed-off-by: Andreas Roehler <[email protected]>
(1 to 1000).toList.filter(x => f(x)) | ||
} | ||
|
||
nestedIs3Factor(is3Factor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two comments here:
-
Please add an
assert
to verify that the result is correct. -
The function
nestedIs3Factor
could do.filter().toList
instead of.toList.filter()
because filtering will probably leave fewer results, so it's less memory.
Signed-off-by: Andreas Roehler <[email protected]>
Signed-off-by: Andreas Roehler <[email protected]>
Signed-off-by: Andreas Roehler <[email protected]>
def normalize(a: List[Double]): List[Double] = { | ||
|
||
val b = a.map(k => k.abs).max | ||
if (b == 0) a else a.map(_ / 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded division by 4
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Andreas Roehler <[email protected]>
No description provided.