JavaScript/7kyu/Mumbling.js
// The parameter of accum is a string which includes only letters from a..z and A..Z.
The parameter of accum is a string which includes only letters from a..z and A..Z.
The parameter of accum is a string which includes only letters from a .. z and A .. Z .
function accum(s) {
  let arr = s.split('')
  let result = [];
  for (let i = 0; i < arr.length; i++) {
    result.push(arr[i].charAt(0).toUpperCase() + arr[i].toLowerCase().repeat(i));
  }
  return result.join('-');
}
function accum ( s ) { let arr = s . split ( '' ) let result = [ ] ; for ( let i = 0 ; i < arr . length ; i ++ ) { result . push ( arr [ i ] . charAt ( 0 ) . toUpperCase ( ) + arr [ i ] . toLowerCase ( ) . repeat ( i ) ) ; } return result . join ( '-' ) ; }
The parameter of accum is a string which includes only letters from a..z and A..Z.
The parameter of accum is a string which includes only letters from a .. z and A .. Z .