title: Calculate the number of fixed-length strings that contain a given word exactly once
body: <p>For example given the fixed-length N=10 and the word W=&quot;radar&quot;. Also we know we have 26 characters.</p>
  <p>Then we can &quot;easily&quot; calculate the number of strings as:</p>
  <p>radar _ _ _ _ _ -&gt; 26^5-26-1 (because radarradar and radaradar_ is not ok)</p>
  <p>_ radar _ _ _ _ -&gt; 26^5-26</p>
  <p>_ _ radar _ _ _ -&gt; 26^5</p>
  <p>_ _ _ radar _ _ -&gt; 26^5</p>
  <p>_ _ _ _ radar _ -&gt; 26^5-26</p>
  <p>_ _ _ _ _ radar -&gt; 26^5-26-1</p>
  <p>Which is 71288150. Is there a better solution to calculate this? Even, if N can be very large.</p>