-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DRAFT]. Solve LeetCode #10 'Regular Expression Matching' [Hard].
- Loading branch information
1 parent
6361975
commit c559bb6
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LeetCode/src/LeetCode.Challenges/Problems0XX/P010_RegularExpressionMatching/Solution.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Text; | ||
|
||
namespace LeetCode.Challenges.Problems0XX.P010_RegularExpressionMatching; | ||
|
||
public static class Solution | ||
{ | ||
public static bool IsMatch(string str, string pattern) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...LeetCode.Challenges.UnitTests/Problems0XX/P010_RegularExpressionMatching/SolutionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using FluentAssertions; | ||
using LeetCode.Challenges.Problems0XX.P010_RegularExpressionMatching; | ||
using Xunit; | ||
|
||
namespace LeetCode.Challenges.UnitTests.Problems0XX.P010_RegularExpressionMatching; | ||
|
||
public class SolutionTests | ||
{ | ||
[Theory] | ||
[MemberData(nameof(TestData))] | ||
public void GivenStringAndPattern_WhenCallIsMatch_ThenResultAsExpected( | ||
string str, string pattern, bool expectedResult) | ||
Check warning on line 12 in LeetCode/tests/LeetCode.Challenges.UnitTests/Problems0XX/P010_RegularExpressionMatching/SolutionTests.cs GitHub Actions / build
Check warning on line 12 in LeetCode/tests/LeetCode.Challenges.UnitTests/Problems0XX/P010_RegularExpressionMatching/SolutionTests.cs GitHub Actions / build
|
||
{ | ||
var action = () => Solution.IsMatch(str, pattern); | ||
action.Should().Throw<NotImplementedException>(); | ||
} | ||
|
||
public static IEnumerable<object[]> TestData() | ||
{ | ||
yield return ["aa", "a", false]; | ||
yield return ["aa", "a*", true]; | ||
yield return ["ab", ".*", true]; | ||
} | ||
} |