Skip to content

Commit 1536489

Browse files
Update algorithms/sliding_window/substring_concatenation/__init__.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 1a71df5 commit 1536489

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • algorithms/sliding_window/substring_concatenation

algorithms/sliding_window/substring_concatenation/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def find_substring(s: str, words: List[str]) -> List[int]:
4646

4747

4848
def find_substring_2(s: str, words: List[str]) -> List[int]:
49+
if not s or not words:
50+
return []
51+
4952
# Each word has the same length
5053
word_len = len(words[0])
5154
# Total number of words

0 commit comments

Comments
 (0)