First draft of horizontal seams with memoization