         let stringLength: Int = (s!).characters.count
         let wordsListSize: Int = words.count
         let wordLength: Int = words[0].characters.count
-        for var i = 0; i < wordsListSize; i++ {
+        for i in 0 ..< wordsListSize {
             if dict1[words[i]] == nil {
                 dict1[words[i]] = 1
             } else {

        var s2: String
        var counter1: Int
        var counter2: Int
        for var i = 0; i < wordLength; i++ {
            counter1 = 0
            counter2 = i
            for var j = i; j < stringLength; j += wordLength {
                s1 = s![j..<j+wordLength]
                if dict1[s1] == nil {
                    dict2.removeAll(keepCapacity: false)

                if counter1 == wordsListSize {
                    result.append(counter2)
                    s2 = s![counter2..<counter2+wordLength]
                    dict2[s2]! -= 1
                    counter1 -= 1
                    counter2 += wordLength
                }
                j += wordLength
            }
            dict2.removeAll(keepCapacity: false)
        }
