title: Why I Cannot subscript a value of type '[String : [String]]' with an argument of type 'String.SubSequence' (aka 'Substring')?
body: <p>I have an array that I want to convert to a dictionary and I declared a function to do so but I get this error each time I compile 
  "Cannot subscript a value of type '[String : [String]]' with an argument of type 'String.SubSequence' (aka 'Substring')" </p>
  
  <p>my code is </p>
  
  <pre><code>let animals = ["Bear", "Black Swan", "Buffalo", "Camel", "Cockatoo", "Dog", "Donkey", "Emu", "Giraffe", "Greater Rhea", "Hippopotamus", "Horse", "Koala", "Lion", "Llama", "Manatus", "Meerkat", "Panda", "Peacock", "Pig", "Platypus", "Polar Bear", "Rhinoceros", "Seagull", "Tasmania Devil", "Whale", "Whale Shark", "Wombat"]
     var animalsDict = [String: [String]]()
      var animalSectionTitles = [String]()
  
   func createAnimalDict() {
          for animal in animals {
              let secondLetterIndex = animal.index(animal.startIndex, offsetBy: 1)
              let animalKey = animal[..&lt;secondLetterIndex]
              if var animalValues = animalsDict[animalKey] {
                  animalValues.append(animal)
                  animalsDict[animalKey] = animalValues
              }else {
                  animalsDict[animalKey] = [animal]
              }
          }
          animalSectionTitles = [String](animalsDict.keys)
          animalSectionTitles = animalSectionTitles.sorted(by: { $0 &lt; $1 })
      }
  </code></pre>
  
  <p>I expect to get this dictionary after converting to fill a tableview with this dictionary which its key refer to section title and its values refer to the rows' titles</p>
  
  <pre><code>let animals: [String: [String]] = ["B" : ["Bear", "Black Swan", "Buffalo"],
  
  "C" : ["Camel", "Cockatoo"],
  
  "D" : ["Dog", "Donkey"],
  
  "E" : ["Emu"],
  
  "G" : ["Giraffe", "Greater Rhea"],
  
  "H" : ["Hippopotamus", "Horse"],
  
  "K" : ["Koala"],
  
  "L" : ["Lion", "Llama"],
  
  "M" : ["Manatus", "Meerkat"],
  
  "P" : ["Panda", "Peacock", "Pig", "Platypus", "Polar Bear"],
  
  "R" : ["Rhinoceros"],
  
  "S" : ["Seagull"],
  
  "T" : ["Tasmania Devil"],
  
  "W" : ["Whale", "Whale Shark", "Wombat"]]
  </code></pre>