Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1ec3ff3

Browse files
code refactored
1 parent 02c81b2 commit 1ec3ff3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎DynamicProgramming/abbrevation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
daBcd -> capitalize a and c(dABCd) -> remove d (ABC)
1212
"""
1313

14-
def abbrevation(first_input: str, second_input: str) -> bool:
14+
def need_transform(first_input: str, second_input: str) -> bool:
1515
"""
16-
Determines if string a can be transformed into string b by capitalizing
16+
Determines if string first_input can be transformed into string second_input by capitalizing
1717
zero or more lowercase letters and deleting all other lowercase letters.
1818
1919
Args:
20-
a (str): The original string.
21-
b (str): The target string.
20+
first_input (str): The original string.
21+
second_input (str): The target string.
2222
2323
Returns:
24-
bool: True if a can be transformed into b, False otherwise.
24+
bool: True if first_input can be transformed into second_input, False otherwise.
2525
"""
2626

2727
dp = [[False] * (len(first_input) + 1) for _ in range(len(second_input) + 1)]
@@ -37,4 +37,4 @@ def abbrevation(first_input: str, second_input: str) -> bool:
3737

3838
return dp[len(second_input)][len(first_input)]
3939

40-
print(abbrevation("daBcd", "ABC"))
40+
print(need_transform("daBcd", "ABC"))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /