We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4fd216 commit f7b3996Copy full SHA for f7b3996
Knuth-Morris-Pratt/KnuthMorrisPratt.playground/Contents.swift
@@ -1,13 +1,8 @@
1
//: Playground - noun: a place where people can play
2
3
-// last checked with Xcode 9.0b4
4
-#if swift(>=4.0)
5
-print("Hello, Swift4!")
6
-#endif
7
-
8
func ZetaAlgorithm(ptnr: String) -> [Int]? {
9
10
- let pattern = Array(ptnr.characters)
+ let pattern = Array(ptnr)
11
let patternLength: Int = pattern.count
12
13
guard patternLength > 0 else {
@@ -65,7 +60,7 @@ extension String {
65
60
66
61
func indexesOf(ptnr: String) -> [Int]? {
67
62
68
- let text = Array(self.characters)
63
+ let text = Array(self)
69
64
let pattern = Array(ptnr.characters)
70
71
let textLength: Int = text.count
0 commit comments