圆素数【难度:1级】: 答案1: def circular_permutations(n):n = str(n)return [int(n[i:] + n[:i]) for i in range(len(n))]def is_prime(n):return n > 1 and all(n % i != 0 for i in range(2, int(n**0.5)+1))def circula
处罚超速【难度:3级】: 答案1: # return str of the smallest value of the combined numbers in a_list# the length of a_list can vary betweem 2 and 20 def penalty(a_list):return ''.join(sorted(a_list, cmp=(lambd
顺时针螺旋【难度:3级】: 答案1: from collections import dequedef createSpiral(N):if type(N) != int or N < 0: return []ans = [[0]*N for i in range(N)]x, y = 0, 0moves = deque([(0,1), (1,0), (0,-1) , (-1,0)])for i