cp-library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub kobejean/cp-library

:heavy_check_mark: cp_library/alg/iter/roll_fn.py

Required by

Verified with

Code

import cp_library.alg.iter.__header__

def roll(A: list, t: int):
    if t:=t%len(A): A[:t], A[t:] = A[-t:], A[:-t]
    return A
'''
╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
             https://kobejean.github.io/cp-library               
'''

def roll(A: list, t: int):
    if t:=t%len(A): A[:t], A[t:] = A[-t:], A[:-t]
    return A
Back to top page