In our case we gave the list of numbers for the input which was around a dozen so memory was not a concern, again keeping the problem pretty simple.