solve() only can solve small size
solve2() can solve large size

the "Stock Span problem" arithmetic is a key.