Skip to content

Commit 2a0ea59

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 346eb5a commit 2a0ea59

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: strings/alternative_string_arrange.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
def alternative_string_arrange(first_str: str, second_str: str) -> str:
22
"""
33
Return the alternative arrangements of the two strings.
4-
5-
This function alternates characters from two input strings. If one string
6-
is longer, the remaining characters will be appended to the end of the
4+
5+
This function alternates characters from two input strings. If one string
6+
is longer, the remaining characters will be appended to the end of the
77
resulting string.
8-
8+
99
:param first_str: The first string to arrange.
1010
:param second_str: The second string to arrange.
1111
:return: A new string with alternating characters from the input strings.
@@ -21,14 +21,14 @@ def alternative_string_arrange(first_str: str, second_str: str) -> str:
2121
"""
2222
max_length: int = max(len(first_str), len(second_str))
2323
result_chars: list = []
24-
24+
2525
for i in range(max_length):
2626
if i < len(first_str):
2727
result_chars.append(first_str[i])
2828
if i < len(second_str):
2929
result_chars.append(second_str[i])
30-
31-
return ''.join(result_chars)
30+
31+
return "".join(result_chars)
3232

3333

3434
if __name__ == "__main__":

0 commit comments

Comments
 (0)