diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/interleaving_string.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/interleaving_string.cpp')
-rw-r--r-- | other/interleaving_string.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/other/interleaving_string.cpp b/other/interleaving_string.cpp deleted file mode 100644 index ed2a5b9..0000000 --- a/other/interleaving_string.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - bool isInterleave(string s1, string s2, string s3) { - memset(t, -1, sizeof(t)); - m = s1.size(); - n = s2.size(); - N = s3.size(); - if (m + n != N) - return false; - return helper(s1, s2, s3, 0, 0); - } - -private: - int m, n, N; - int t[101][101]; - bool helper(string s1, string s2, string s3, int i, int j) { - if (i >= m && j >= n && i + j >= N) - return true; - if (i + j >= N) - return false; - if (t[i][j] != -1) - return t[i][j]; - return t[i][j] = ((s1[i] == s3[i + j] && helper(s1, s2, s3, i + 1, j)) || - (s2[j] == s3[i + j] && helper(s1, s2, s3, i, j + 1))); - } -}; - -int main() { - Solution obj; - string s1 = "aabcc"; - string s2 = "dbbca"; - string s3 = "aadbbcbcac"; - if (obj.isInterleave(s1, s2, s3)) - cout << "true"; - else - cout << "false"; -} |