Skip to content

Commit 4762512

Browse files
Fix runtime for backtracking
1 parent 4123e91 commit 4762512

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/search-for-word-ii.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ class Solution {
341341

342342
### Time & Space Complexity
343343

344-
- Time complexity: $O(m * n * 4 ^ t + s)$
344+
- Time complexity: $O(w * m * n * 4 * 3 ^ t - 1)$
345345
- Space complexity: $O(t)$
346346

347-
> Where $m$ is the number of rows, $n$ is the number of columns, $t$ is the maximum length of any word in the array $words$ and $s$ is the sum of the lengths of all the words.
347+
> Where $w$ is the number of words, $m$ is the number of rows, $n$ is the number of columns and $t$ is the maximum length of any word in the array $words$.
348348
349349
---
350350

0 commit comments

Comments
 (0)