TLE in class assignment

there is a tle in this code while submitting;
code:https://ide.codingblocks.com/s/131113
approach:i initialised the array with x,means no element is present at that position,count denotes number of strings,which is passed with p as pointer,

@shakul
The time complexity of your code is O(t * 2^n) . This is extremely large given the constraints. This problem can be done in O(t + n) time complexity using simple precomputation.
If you look closely at the testcases and answers , you will notice there is a pattern forming up. Just write down the answers for values upto 5 or 6. Notice these values and look out for some pattern forming up. When you find this pattern , write a code to precompute the values for this pattern upto the largest value of n specified in the constraints. After this run the testcase loop and simply output the stored values which we computed during our precomputation part.