title: Splitting an Alphabetical List Into Equal Chunks
body: <p>I've been tasked with splitting a directory of names into four (approximately) equal chunks. The directory is effectively a phonebook that is already alphebatised. The solution has to be generic and work for any directory not just one specific one. If it helps the directory is an array of strings. </p>
  
  <p>For example the four chunks for one directory could be: </p>
  
  <pre><code>A-E, F-L, M-S and T-Z 
  </code></pre>
  
  <p>Whilst another could be </p>
  
  <pre><code>A-B, C-D, E-F and G-Z
  </code></pre>
  
  <p>I've already considered just splitting the size of the directory in 4 and then counting upwards until reaching that number and noting the letter that entry starts with but that isn't particularly elegant. </p>
  
  <p>What I mean by this is: take the directory to be 100 entries. I could divide this by 4 to get 25 (how many entries should be in each chunk). Going through the entries to 25 and then taking that entry should give me the last entry in the first chunk. However, this doesn't work when the number of entries for each letter in the alphabet vary greatly. A-J could all have one entry and K could have 32 entries which would make my process useless. </p>
  
  <p>It would be helpful to have pseudocode instead of a specific C implementation but really a point in the right direction would be a great help. </p>