Timeline for (Brilliant.org) Arrays Intermediate 3: Contiguous Knapsack
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 18, 2019 at 8:35 | history | edited | Graipher | CC BY-SA 4.0 |
added 745 characters in body
|
Mar 18, 2019 at 8:26 | comment | added | Graipher | @TobiAlafin: It is using the code in my question here (and it's answers). | |
Mar 16, 2019 at 7:41 | vote | accept | Tobi Alafin | ||
Mar 16, 2019 at 7:32 | comment | added | Tobi Alafin | How did you do the time graph? That sounds like a very handy utility to have. | |
Mar 15, 2019 at 16:50 | comment | added | Peilonrayz♦ | @Graipher I've not tested it, and don't want to write my own answer. Add it to yours if/when you want :) | |
Mar 15, 2019 at 16:49 | comment | added | Graipher | @Peilonrayz: True. Do you want to add it as your own answer, don't have time for it right now. | |
Mar 15, 2019 at 16:48 | comment | added | Peilonrayz♦ | Unless I'm missing something using a for loop would read better imo. | |
Mar 15, 2019 at 16:23 | comment | added | Graipher | @AustinHastings: Added a version without summing the slice. | |
Mar 15, 2019 at 16:21 | history | edited | Graipher | CC BY-SA 4.0 |
added 328 characters in body
|
Mar 15, 2019 at 16:07 | comment | added | Graipher | @AustinHastings: True, you know the index of the item to subtract... | |
Mar 15, 2019 at 16:05 | comment | added | aghast | You don't need the deque. Just keep the running sum, and subtract items as you remove them from the tail. | |
Mar 15, 2019 at 16:01 | history | answered | Graipher | CC BY-SA 4.0 |