Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Surrounded letter

Instructions

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

Examples

surroundedLetter("+a+") // true

surroundedLetter("+ab+") // false

surroundedLetter("+a+b+") // true

surroundedLetter("+a++b++") // true

Hints

Hint 1 Use can use regex to determine number of available patterns (plus character ; letter ; plus character) in the string.
Hint 2 You can also get number of available letters in the string.