You can change the following code

*if len(arr) == 1 and sum(arr) <= budget:*
*    return 1*

to

*if sum(arr) <= budget:*
*    return len(arr)*


This is because the loop below assume the sum of the array is greater than 
*budget *at some point
so you need to handle the case where the sum of the array is less than 
*budget*.


-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/7941cbbc-9f39-4869-8575-fd1d5faa559e%40googlegroups.com.

Reply via email to