June 17, 2017
Problem statement
It is hard level algorithm. Julia tried the algorithm a few times in mocking experience, she used the algorithm a few time to interview and also was interviewed.
Now it is 9:36 am, Julia likes to read some discussion. Plan to spend 20 - 30 minutes.
First, Julia was advised in mocking experience to use recursive function to make the code more easy to write.
Special test cases are looked into:
1. ?*, any character repeated multiple time, ? represents any character, * means repeating multiple times.
2. If string is finished, but the pattern string is not, it is still possible to match. Pattern string ?*, a* or a*b* etc.
3. Some challenging matching, like "aaa" to match "a*a", how to wisely calculate a* pattern to match first two chars instead of all three characters.
Study code using DP solution - link is here.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Showing posts with label Leetcode 44. wildcard matching. Show all posts
Showing posts with label Leetcode 44. wildcard matching. Show all posts
Saturday, June 17, 2017
Subscribe to:
Posts (Atom)