find best seats algorithm