Reverse an Array

    0

    0

    CrypticSai-08

    def reverseList(A, start, end):
      while start < end:
        A[start], A[end] = A[end], A[start]
        start += 1
        end -= 1
    # Driver function to test above function
    A = [10, 20, 30, 40, 50]
    reverseList(A, 0, 4)
    print(A)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.