Циклическая перестановка последовательности
1 2 3 | def rotate_left(seq, n):
return (seq[n-1::-1] + seq[:n-1:-1])[::-1]
|
blog comments powered by Disqus
1 2 3 | def rotate_left(seq, n):
return (seq[n-1::-1] + seq[:n-1:-1])[::-1]
|