Cover interval with minimum sum intervals - DP recursion depth problem
You can always convert any recursive algorithm (that uses the call stack) into a iterative algorithm where you explicitly push and pop onto a stack that you manage.  This should eliminate recursion depth exceeded errors.