         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 {

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

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