Saturday, February 17, 2018

Remove invalid parentheses

Feb. 17, 2018

Introduction


It is my most favorite algorithm to work on recently. I started to work on Leetcode 301 - remove invalid parentheses, a hard level algorithm

Time line


Step 1:

I had 9:30 AM mock interview, and the algorithm I had to work on is to find minimum valid parentheses. Based on the interviewer's advise, I had to work on step 1, remove invalid parentheses.

It should take me at most 20 to 25 minutes to finish the algorithm and also coding, but I actually spent over 35 minutes but the code has bugs.

Here is the code in mock interview

Step 2:

Started from 1 PM, I worked on the code I wrote in mock interview, completed the code, and the code has bug. Here is the code.

Step 3:

2:47 pm, I rewrote the code using different design, and complete the test cases. The code is here for remove invalid parentheses.

Step 4:

Not it is 2:55 PM, I organized all the past practice Leetcode 301, added tag for each post using tag: Leetcode 301: remove invalid parentheses. All the past practice can be looked up by the tag now.


Actionable Items


March 5, 2018 8:10 PM
It has been more than three weeks, I think about carefully what really the problem is for this algorithm problem solving.

I need to simplify the problem I need to solve.

No comments:

Post a Comment