Skip to content

Commit 007a4f6

Browse files
Fix parse error in z algorithm search (#291)
1 parent fb928c3 commit 007a4f6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

searches/z.algorithm.search.r

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ text <- tolower(readline("Enter text: "))
3131
pattern <- tolower(readline("Enter pattern: "))
3232

3333
matches <- z_algorithm_search(text, pattern)
34-
if (length(matches) > 0)
34+
if (length(matches) > 0) {
3535
cat("Pattern found at positions:", matches, "\n")
36-
else
37-
cat("Pattern not found.\n")
36+
} else {
37+
cat("Pattern not found.\n")
38+
}

0 commit comments

Comments
 (0)