leetcode1033】的更多相关文章

Three stones are on a number line at positions a, b, and c. Each turn, let's say the stones are currently at positions x, y, z with x < y < z.  You pick up the stone at either position x or position z, and move that stone to an integer position k, w…
class Solution: def numMovesStones(self, a: int, b: int, c: int) -> 'List[int]': l = list() l.append(a) l.append(b) l.append(c) l = sorted(l) r = list() minval = 0 maxval = 0 if l[1] - l[0] == 1 and l[2] - l[1] == 1: return [minval,maxval] elif (l[1]…