From 476251293b343e6685601dd1766d21fe9a0e5afc Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 11 Aug 2025 19:35:55 -0600 Subject: [PATCH] Fix runtime for backtracking --- articles/search-for-word-ii.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/articles/search-for-word-ii.md b/articles/search-for-word-ii.md index 9451914a1..f34cca724 100644 --- a/articles/search-for-word-ii.md +++ b/articles/search-for-word-ii.md @@ -341,10 +341,10 @@ class Solution { ### Time & Space Complexity -- Time complexity: $O(m * n * 4 ^ t + s)$ +- Time complexity: $O(w * m * n * 4 * 3 ^ t - 1)$ - Space complexity: $O(t)$ -> 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. +> 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$. ---