4 ms·
The challenge was: --- We get a list of up to 50 activities and an associated calorie value for each (either positive or negative), we need to find a subset o
by warrenwilkinson 16y ago
The challenge was:
---
We get a list of up to 50 activities and an associated calorie value for each (either positive or negative), we need to find a subset of activities where the sum of all the calorie values is zero.
---
Did anyone else here immediately think to write a function hard coded to return the empty set?
- xal 16y agoHehe yes, and I feel kinda bad for that. I think it's some permanent damage that I picked up from pair programming using unit tests and my desire to troll my pair partner into doing all the actual typing.