Timeline for Sum of all integers from 1 to n
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 19, 2017 at 12:37 | history | edited | Dylan Meeus | CC BY-SA 3.0 |
added 251 characters in body
|
Jul 19, 2017 at 12:34 | comment | added | Dylan Meeus | @TheLethalCoder thanks! I just found another Java answer to this thread which indeed does it a great deal shorter and does not print ^^ | |
Jul 19, 2017 at 12:34 | comment | added | TheLethalCoder | Side note: Use four spaces to format the code not back ticks. | |
Jul 19, 2017 at 12:34 | history | edited | TheLethalCoder | CC BY-SA 3.0 |
added 2 characters in body
|
Jul 19, 2017 at 12:34 | comment | added | TheLethalCoder |
(n) can be just n . You can return from the lambda, I believe, instead of printing. And yes it's fine to compile to a lambda.
|
|
Jul 19, 2017 at 12:33 | history | edited | Dylan Meeus | CC BY-SA 3.0 |
added 197 characters in body
|
Jul 19, 2017 at 12:33 | history | edited | TheLethalCoder | CC BY-SA 3.0 |
added 2 characters in body
|
Jul 19, 2017 at 12:32 | history | answered | Dylan Meeus | CC BY-SA 3.0 |