Skip to main content
Commonmark migration
Source Link

#JavaScript, 57 bytes

JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.

#JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.

JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.

Detailing input format
Source Link
Mwr247
  • 3.6k
  • 18
  • 39

#JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.

#JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem.

#JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem. The first parameter is the initial number as a string, and the second is the number of iterations.

Source Link
Mwr247
  • 3.6k
  • 18
  • 39

#JavaScript, 57 bytes

F=(a,b)=>b?F(a.replace(/(.)\1*/g,c=>c.length+c[0]),b-1):a

Recursion works well for this problem.