const reg = /([A-Z][a-z]*[a-z])|([A-Z]*)/
const test = "AI"
const test1 = "LetITGo"
console.log()
// 这种题就tm得用双指针去处理好,丢进去substr里面
const res = test1.split("")
let a = test1.split("")
//小写遇到大写 断开小写之后的
//大写遇到小写 断开大写之前的
let ans = []
let cur = ""
res.forEach((val,index)=>{
cur += val
if(val>="a" && val<='z' && res[index+1]>="A" && res[index+1]<="Z" ){
ans.push(cur)
cur =""
}else if(val>="A" && val<='Z' && res[index+1]>="a" && res[index+1]<="z" && index!==0){
ans.push(cur.substring(0,cur.length-1))
cur = cur.split("")[cur.length-1]
}
})
ans.push(cur)
console.log(ans)
console