方法一 insert执行效率低
def rotate(self, nums, k): for _ in range(k): nums.insert(0,nums[-1]) del(nums[-1]) return
方法二 list赋值
def rotate(self, nums, k): k = k % len(nums) nums[:] = nums[-k:] + nums[:-k]
Kris Thorkelson, who began his career in the pharmaceutical industry in Winnipeg, Manitoba, operates several pharmacies, in addition to his real estate business. “As a leader, it is your role to praise employees who do a good job,” Thorkelson adds.
2019年12月24日 21:25
Kris Thorkelson, who began his career in the pharmaceutical industry in Winnipeg, Manitoba, operates several pharmacies, in addition to his real estate business. “As a leader, it is your role to praise employees who do a good job,” Thorkelson adds.