Help me in solving DAA017 problem

My issue

Actually I got the output of this program, But it showing “Hidden case is fail” and I’m expect help immediately

My code

def partition(a, size_a):
    if size_a <= 1:
        return

    pivot = a[size_a - 1]
    idx = 0

    for i in range(size_a - 1):
        if a[i] <= pivot:
            a[idx], a[i] = a[i], a[idx]
            idx += 1

    a[idx], a[size_a - 1] = a[size_a - 1], a[idx]


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    partition(a, n)

    for i in range(n):
        print(a[i], end=" ")

    print()

Learning course: Design and Analysis of Algorithms
Problem Link: https://www.codechef.com/learn/course/kl-daa/KLDAA2403/problems/DAA017