title: Permutation of lengthy string
body: <p>The following is the question I tried solving :</p>
  
  <blockquote>
    <p>A string contains characters from '0' to '9'. Now  find out the total possible permutations for this string. Since the number can be very large, output the number modulus 10^9+7.</p>
    
    <blockquote>
      <p>Input : 
      First line represent the number of test cases(T).
      Each test case contains a string of digits.
      Output : 
      For each test case output the required result.</p>
      
      <p>Constraints :
      T&lt;=100. Length of String &lt;= 1000 </p>
    </blockquote>
  </blockquote>
  
  <p>So, I assumed that I just need to find out len! where len is the length of the string. 
  My code for finding out the factorial is as follows : </p>
  
  <pre><code>long long int fact(long long int n)
  {
  if(n&lt;=1)
  return 1;
  else
  return (len * fact(len-1))%1000000007;
  }
  </code></pre>
  
  <p>But I keep getting WA for this code. Disregarding the Output format issues, is the above code for finding out the factorial correct? Or should I use a different approach?</p>
  
  <p>NOTE: I also changed the algorithm so that repetition of certain characters is handled by dividing the answer by the product of factorial of the occurrences of each character.</p>