Thursday, July 6, 2017

Leetcode 10: Regular Expression Match - One bug a time

July 6, 2016

Introduction


The regular expression match is the hard algorithm. Julia learns the algorithm more than five time last three months. She learns how to write the code in less than 20 lines of code, but also she learns to write the code with an iterative solution, ends up with more work and time-consuming bugs.



Algorithm Code Review 



Her practice using C# on May 16 is here. There are a few bugs in her writing.

Here are some highlights of bugs:
1. Line 27 - line 41, counter example, "" and pattern string "a*" or "a*b*". "" matches "a*"
2. Line 77 - 79,
3. Line 84
4. line 90

C# code with a bug.

The C# code passes all test cases. The code is here

No comments:

Post a Comment