Implemented the maximum sub sequence problem