View gist:730957b8da1e4107c5ef
function lengthOfSequence(arr, x) {
arr.unshift(' '); arr.push(' ');
var rel = arr.join(' ').split(' ' + x + ' ');
if (rel.length !== 3) return 0;
return rel[1].split(' ').length + 2;
}