Skip to main content
edited tags; added 9 characters in body; deleted 1 character in body
Source Link
200_success
  • 145.7k
  • 22
  • 191
  • 481

Implement regular expression matching with support for '.' and ''. '.' Matches any single character. ''*'. '.' Matches any single character. '*' Matches zero or more of the preceding element.

The matching should cover the entire input string (not partial).

The function prototype should be: bool isMatch(const char *s, const char *p)

Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false

isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa", "a*") → true
isMatch("aa", ".*") → true
isMatch("ab", ".*") → true
isMatch("aab", "c*a*b") → true

isMatch("aa", "a*") → true
isMatch("aa", ".") → true
isMatch("ab", ".
") → true
isMatch("aab", "cab") → true

Implement regular expression matching with support for '.' and ''. '.' Matches any single character. '' Matches zero or more of the preceding element.

The matching should cover the entire input string (not partial).

The function prototype should be: bool isMatch(const char *s, const char *p)

Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false

isMatch("aa", "a*") → true
isMatch("aa", ".") → true
isMatch("ab", ".
") → true
isMatch("aab", "cab") → true

Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element.

The matching should cover the entire input string (not partial).

The function prototype should be: bool isMatch(const char *s, const char *p)

Some examples:

isMatch("aa","a") → false
isMatch("aa","aa") → true
isMatch("aaa","aa") → false
isMatch("aa", "a*") → true
isMatch("aa", ".*") → true
isMatch("ab", ".*") → true
isMatch("aab", "c*a*b") → true
Removed non-question related content
Source Link
RubberDuck
  • 31.2k
  • 6
  • 74
  • 177

Practice like sports

It is holiday of 2017, and I like to have more hats in this winter bash, so I like to ask more questions on code review. One thing I like to share is that I have a role model who is a tennis star, I always encourage myself using her quotes, "I am always first one to arrive and last one to leave. Forget everyone else, put your work in. Create your own mark." I embed the twitter link inside here as well. I keep practice same algorithm Leetcode 10 over and over again, and I think that the programming is like tennis sport, you work on drills to help yourself, recursive function, memoization those are great things to practice again and again.

Forget what everybody else is doing.@kikimladenovic is the first on court and the last one off.#CreateYourMarkpic.twitter.com/3E7n6psKdF— adidas tennis(@adidastennis)May 18, 2016

Practice like sports

It is holiday of 2017, and I like to have more hats in this winter bash, so I like to ask more questions on code review. One thing I like to share is that I have a role model who is a tennis star, I always encourage myself using her quotes, "I am always first one to arrive and last one to leave. Forget everyone else, put your work in. Create your own mark." I embed the twitter link inside here as well. I keep practice same algorithm Leetcode 10 over and over again, and I think that the programming is like tennis sport, you work on drills to help yourself, recursive function, memoization those are great things to practice again and again.

Forget what everybody else is doing.@kikimladenovic is the first on court and the last one off.#CreateYourMarkpic.twitter.com/3E7n6psKdF— adidas tennis(@adidastennis)May 18, 2016
add some words to make sentence more logical correct.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52

It is the hard level algorithm on Leetcode.com. And there are over 710 thousands submissions. I usually find that hard level algorithm is hard to learn and then I do not have chanceexperience before to learn and practice one hard level algorithm very well.

Because I have practiced the mock interview 5 rounds with same 30 algorithms since this March, and then I wrote this algorithm five times in mock interview, and also I interviewed peers over 5 times. This is the first hard level algorithm I have practiced over 10 times last 9 months and I found very challenging. I like to list a few practices at the end of questions as references, in case other people have interest to learn one hard level algorithm as I have done.

It is the hard level algorithm on Leetcode.com. And there are over 710 thousands submissions. I usually find that hard level algorithm is hard to learn and then I do not have chance to learn one hard level algorithm very well.

Because I have practiced the mock interview 5 rounds with same 30 algorithms since this March, and then I wrote this algorithm five times in mock interview, and also I interviewed peers over 5 times. This is the first hard level algorithm I have practiced over 10 times and I found very challenging. I like to list a few practices at the end of questions as references, in case other people have interest to learn one hard level algorithm as I have done.

It is the hard level algorithm on Leetcode.com. And there are over 710 thousands submissions. I usually find that hard level algorithm is hard to learn and then I do not have experience before to learn and practice one hard level algorithm very well.

Because I have practiced the mock interview 5 rounds with same 30 algorithms since this March, and then I wrote this algorithm five times in mock interview, and also I interviewed peers over 5 times. This is the first hard level algorithm I have practiced over 10 times last 9 months and I found very challenging. I like to list a few practices at the end of questions as references, in case other people have interest to learn one hard level algorithm as I have done.

add some context about timeout analysis.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
time complexity update on the test case from 2^10 to 2^20
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
Add one more twitter link to help promoting the ideas of "Forget everyone else, put your work in".
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
add one statement to save false to the memo.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
Add some explanation about learning a hard level algorithm.
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading
Source Link
Jianmin Chen
  • 2.5k
  • 2
  • 29
  • 52
Loading