遍历+正则表达式
function containsRepeatingLetter(str) {
const n=str.length;
if(n<=1){return false}
for(let i=1;i<n;i++){
if(str[i]===str[i-1] && /[a-zA-Z]/.test(str[i])){
return true
}
}
return false;
}
遍历+正则表达式
function containsRepeatingLetter(str) {
const n=str.length;
if(n<=1){return false}
for(let i=1;i<n;i++){
if(str[i]===str[i-1] && /[a-zA-Z]/.test(str[i])){
return true
}
}
return false;
}