Timeline for Alone in a Couple implementation in Java
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 1, 2018 at 10:39 | comment | added | DarkWiiPlayer | Or you could just implement a new set object that allows to "toggle" values. Then you could move the loop into the main program entirely. | |
Aug 1, 2018 at 10:34 | comment | added | DarkWiiPlayer | @AnkitSoni I don't see how wasting memory needlessly in favor of reusability is a good thing, specially when there's no indication that the method will ever be reused for anything. If so, it is still trivial to change it to work with an array or add a further step of abstraction and make it work with an iterator, which could be used both for an array and a stream (without reading said stream into an array first). | |
Aug 1, 2018 at 10:18 | comment | added | Ankit Soni |
Passing Scanner to getAloneNum method doesn't look like a good idea because the method should do only one job, and that's to find the lone number, else it won't be reusable.
|
|
Aug 1, 2018 at 9:57 | history | answered | DarkWiiPlayer | CC BY-SA 4.0 |