uva 131 and leetcode stock problem