Skip to content

Commit

Permalink
Implement some black changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nictru committed Jan 28, 2024
1 parent bf36216 commit 020293c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/text_search/boyer_moore.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def boyer_moore_bc(text: str, pattern: str, verbose: bool = False) -> bool:
else:
raise ValueError("Invalid algorithm")

print("Found") if algorithm(args.text, args.pattern, args.verbose) else print(
"Not found"
(
print("Found")
if algorithm(args.text, args.pattern, args.verbose)
else print("Not found")
)
6 changes: 4 additions & 2 deletions src/text_search/knuth_morris_pratt.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def kmp(text: str, word: str, verbose: bool = False) -> bool:

args = parser.parse_args()

print("Found") if kmp_z(args.text, args.pattern, args.z, args.verbose) else print(
"Not found"
(
print("Found")
if kmp_z(args.text, args.pattern, args.z, args.verbose)
else print("Not found")
)

0 comments on commit 020293c

Please sign in to comment.