You are given two strings, pattern
and value
. The pattern
string consists of just the letters a
and b
, describing a pattern within a string. For example, the string catcatgocatgo
matches the pattern aabab
(where cat
is a
and go
is b
). It also matches patterns like a
, ab
, and b
. Write a method to determine if value
matches pattern
.