... and if $target < 0 no list fulfills the condition, so return 0 if $target < 0; is the second hint
Update: no, sorry, I wrongly assumed that the array containn only positive integers...
So the second hint should be return 0 if @array==0
Rule One: Do not act incautiously when confronting a little bald wrinkly smiling man.
In reply to Re^3: Recursion problem
by psini
in thread Recursion problem
by someone202
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |