Added problem 5 optimal solution. Fixed some issues in my python solution