• + 2 comments

    I was wondering why can't i solve this using combinations from itertools? Anyone who can find flaws in this approach?

    from itertools import combinations
    def countArray(n, k, x):
        if x==1:
            return 1
        c=list(combinations(range(k),n-2))
        print(c)
        return len(c)%((10^9)+7)