Simple Symbols

Published by Mubashir Hassan in

Create a function that takes a string and determine if it's a valid sequence by either returning true or false. The string will be composed of + and = symbols with several characters between them (e.g. "++d+===+c++==a") and for the string to be true, each letter must be surrounded by a + symbol. So the string to the left would be false.

Examples

simple_symbols("f++d+") ➞ false

simple_symbols("+d+=3=+s+") ➞ true

simple_symbols("==+p+++++++++====8+z++++") ➞ true

Notes

The given string will not be empty and will have at least one letter.

Watch a quick demo on how Edabit works.