You are viewing a single comment's thread. Return to all 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)
Seems like cookies are disabled on this browser, please enable them to open this website
Construct the Array
You are viewing a single comment's thread. Return to all comments →
I was wondering why can't i solve this using combinations from itertools? Anyone who can find flaws in this approach?