aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-29 14:01:42 +0100
committerMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-29 14:01:42 +0100
commit4b8444c1b5a8c11fee7f3343700add87acc5c81a (patch)
treef57c4d03a437d33354a8dc00a36e862669708471
parentc0fd3c3e8e7e931ef8c91f43c28bffcbf6da3d11 (diff)
downloadperlweeklychallenge-club-4b8444c1b5a8c11fee7f3343700add87acc5c81a.tar.gz
perlweeklychallenge-club-4b8444c1b5a8c11fee7f3343700add87acc5c81a.tar.bz2
perlweeklychallenge-club-4b8444c1b5a8c11fee7f3343700add87acc5c81a.zip
- Updated solutions.
-rw-r--r--challenge-341/mohammad-anwar/perl/ch-1.pl1
-rw-r--r--challenge-341/mohammad-anwar/python/ch-1.py10
2 files changed, 6 insertions, 5 deletions
diff --git a/challenge-341/mohammad-anwar/perl/ch-1.pl b/challenge-341/mohammad-anwar/perl/ch-1.pl
index 64517020a8..7ca576e264 100644
--- a/challenge-341/mohammad-anwar/perl/ch-1.pl
+++ b/challenge-341/mohammad-anwar/perl/ch-1.pl
@@ -22,4 +22,3 @@ my $examples = [
is(typable_word_count($_->{str}, $_->{keys}), $_->{exp}) for @$examples;
done_testing;
-
diff --git a/challenge-341/mohammad-anwar/python/ch-1.py b/challenge-341/mohammad-anwar/python/ch-1.py
index 1dbd7869c8..3ef9163dd6 100644
--- a/challenge-341/mohammad-anwar/python/ch-1.py
+++ b/challenge-341/mohammad-anwar/python/ch-1.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
def typable_word_count(text: str, broken_keys: list[str]) -> int:
words = text.split()
if not broken_keys:
@@ -12,11 +14,11 @@ def typable_word_count(text: str, broken_keys: list[str]) -> int:
return typable_count
examples = [
- ('Hello World', ['d'], 1),
- ('apple banana cherry', ['a', 'e'], 0),
- ('Coding is fun', [], 3),
+ ('Hello World', ['d'], 1),
+ ('apple banana cherry', ['a', 'e'], 0),
+ ('Coding is fun', [], 3),
('The Weekly Challenge', ['a', 'b'], 2),
- ('Perl and Python', ['p'], 1),
+ ('Perl and Python', ['p'], 1),
]
for text, keys, expected in examples: