youngz

Results 2 comments of youngz

跟大家一样用了正则 🤔 ``` const getMaxContiniu = (str = '') => { const res = {}; let max = 0; arr = str.match(/(.)\1+/g) if (!arr) return res; arr.map((item) => { const...

> > > ``` > > > const arr = str.match(/(\w)\1*/g); > > > const maxLen = Math.max(...arr.map(s => s.length)); > > > const result = arr.reduce((pre, curr) => {...