Skip to content

Commit d2b310d

Browse files
committed
dna 02
Signed-off-by: Drew Wock <dwock@esri.com>
1 parent 8af615d commit d2b310d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

rounds/3_dna/solution.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def find_matches(fasta_path: str, pattern: bytes) -> list[tuple[str, list[int]]]
1515
# TODO: remove this delegation and write your own implementation here.
1616
# Step 1: read the whole FASTA file as text and decode the pattern so the
1717
# search below can use a single ``str`` API.
18-
pattern_str = pattern.decode("ascii")
1918
with open(fasta_path, "r") as f:
2019
text = f.read()
2120

@@ -38,9 +37,7 @@ def find_matches(fasta_path: str, pattern: bytes) -> list[tuple[str, list[int]]]
3837
sequence = "".join(lines[1:]).replace(" ", "")
3938

4039
positions: list[int] = []
41-
print(sequence)
42-
for m in regex.finditer(sequence):
43-
positions.append(m.start())
40+
positions = [m.start() for m in regex.finditer(sequence)]
4441
if positions:
4542
matches.append((record_id, positions))
4643
return matches

0 commit comments

Comments
 (0)