mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-14 07:55:11 +08:00
Update wildcard_matching.cpp
This commit is contained in:
@@ -35,10 +35,10 @@ namespace wildcard_matching {
|
|||||||
* @param pos2 is the last index
|
* @param pos2 is the last index
|
||||||
* @returns 1 if pattern matches with matching string otherwise 0
|
* @returns 1 if pattern matches with matching string otherwise 0
|
||||||
*/
|
*/
|
||||||
std::vector<std::vector<int>> dpTable(1000, std::vector<int>(1000, -1));
|
std::vector<std::vector<int64_t>> dpTable(1000, std::vector<int64_t>(1000, -1));
|
||||||
int32_t wildcard_matching(std::string s, std::string p, int pos1, int pos2) {
|
uint32_t wildcard_matching(std::string s, std::string p, uint32_t pos1, uint32_t pos2) {
|
||||||
int n = s.length();
|
uint32_t n = s.length();
|
||||||
int m = p.length();
|
uint32_t m = p.length();
|
||||||
// matching is successfull if both strings are done
|
// matching is successfull if both strings are done
|
||||||
if (pos1 == n && pos2 == m) {
|
if (pos1 == n && pos2 == m) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user