Example pattern:
Given pattern = "xyyx", str = "red black black red", return true.
Given pattern = "xyyx", str = "red black black green", return false.
Given pattern = "xxxx", str = "red black black red", return false.
Given pattern = "xxxx", str = "red red red red", return true.
Expected Output:
Is the string and pattern matched? false
Code:
Outpu:
need an explanation for this answer? contact us directly to get an explanation for this answer