Advertisement

2. Acceptable Sequence | JavaScript | Coding Interview | Challenge

2. Acceptable Sequence | JavaScript | Coding Interview | Challenge #Challenge

You are given a `string` containing `letters` and the `+` and `=` symbols as an argument.
You need to return `true` if the given `string` is an acceptable sequence, otherwise return `false`.

In this case, an acceptable sequence should return `true` if each `letter` is surrounded by a `+` symbol.

Example:

acceptableSequence('a=+++==b+==c+')
/* returns false
because 'a' is not surrounded by the + symbol on each sides
*/

acceptableSequence('+x+===+y+++z++')
/* returns true
because every letter is surrounded by the + symbol
*/


#javascript #interview #codingchalenge #interviewquestions #acceptablesequence

JavaScript,Coding,Interview,CodingInterview,Challenge,Array,Object,Error,JS,ES6,React,Angular,askFaran,

Post a Comment

0 Comments