boat lift legs, minimum number of flips required leetcode