Given a string containing letters and +
characters implement a function which determines if each letter in the string
is surrounded by +
character. There may be more than one +
character between letters (+a++b+
) and letters may be
surrounded by the same +
character (+a+b+
).
Challenge | Solution |
surroundedLetter("+a+") // true
surroundedLetter("+ab+") // false
surroundedLetter("+a+b+") // true
surroundedLetter("+a++b++") // true