Skip to content

Conversation

Pegasus02K
Copy link
Contributor

C++ solution for 212-Word-Search-II

Credit goes to https://www.youtube.com/watch?v=EmvsBM7o-5k

Exceeded the time limit for following test case with visited unordered_set with "r:c" style string key. Could have tried improving key style, but this solution is much simpler and more effective.

[["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"]]
["a","aa","aaa","aaaa","aaaaa","aaaaaa","aaaaaaa","aaaaaaaa","aaaaaaaaa","aaaaaaaaaa"]

C++ solution for 212-Word-Search-II

Credit goes to https://www.youtube.com/watch?v=EmvsBM7o-5k

Exceeded the time limit for following test case with visited unordered_set with "r:c" style string key. Could have tried improving key style, but this solution is much simpler and more effective.

[["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"],["a","a","a","a","a","a","a","a","a","a","a","a"]]
["a","aa","aaa","aaaa","aaaaa","aaaaaa","aaaaaaa","aaaaaaaa","aaaaaaaaa","aaaaaaaaaa"]
@neetcode-gh neetcode-gh merged commit 516d314 into neetcode-gh:main Apr 8, 2022
neetcode-gh added a commit that referenced this pull request Jul 2, 2022
Create 212-Word-Search-II.cpp
briannej added a commit to briannej/leetcode that referenced this pull request Aug 27, 2023
briannej added a commit to briannej/leetcode that referenced this pull request Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants