Solution to Regular Expression Matching by LeetCode

30 Mar


Question Name: Regular Expression Matching

Year ago, at the first time I read the book “Beautiful Code”, I was completely shocked by the amazingly beautiful regular expression matcher. It is elegant, simple, and really beautiful. As that book saying:

Beautiful code is likely to be simple — clear and easy to understand. Beautitful code is likely to be compact — just enough code to do the job and no more — but not cryptic, to the point where it cannot be understood. Beautiful code may well be general, solving a broad class of problems in a uniform way. One might even describe it as elegant, showing good taste and refinement.

by Brian Kernighan

Every software engineer should read it.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!