Monday, June 22, 2020

LeetCode 301. Remove Invalid Parentheses - DFS case study by Huahualeetcode

Here is the link.



Here is the code example in C++.

I spent 25 minutes to watch the video. The explanation is very clear and very straightforward to apply BFS, no pruning. I do like to work on the solution first using DFS, make it work, and then think about more if I have time to add some pruning ideas. 



C++ code is also saved in a gist. Here is the gist.



I will write a C# solution using the same idea. 

No comments:

Post a Comment