Skip to main content
saved 3 bytes
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES11), 6562 bytes

Expects ([str1, str2]).

f=a=>[...a+a].map(a,i=0)=>(a+a_,i)[i]?[a[i&1]=>a[i&1].match(/(.)\1*/g)?.[i>>1]]+f(a,i+1[i>>1]):"".join``

Attempt This Online!Attempt This Online!

JavaScript (ES11), 65 bytes

Expects ([str1, str2]).

f=(a,i=0)=>(a+a)[i]?[a[i&1].match(/(.)\1*/g)?.[i>>1]]+f(a,i+1):""

Attempt This Online!

JavaScript (ES11), 62 bytes

Expects ([str1, str2]).

a=>[...a+a].map((_,i)=>a[i&1].match(/(.)\1*/g)?.[i>>1]).join``

Attempt This Online!

saved 2 bytes
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES11), 6765 bytes

Expects ([str1, str2]).

f=(a,i=j=0i=0)=>(a+a)[j][i]?[a[i][a[i&1].match(/(.)\1*/g)?.[j]]+f[i>>1]]+f(a,i^1,j+=ii+1):""

Attempt This Online!Attempt This Online!

JavaScript (ES11), 67 bytes

Expects ([str1, str2]).

f=(a,i=j=0)=>(a+a)[j]?[a[i].match(/(.)\1*/g)?.[j]]+f(a,i^1,j+=i):""

Attempt This Online!

JavaScript (ES11), 65 bytes

Expects ([str1, str2]).

f=(a,i=0)=>(a+a)[i]?[a[i&1].match(/(.)\1*/g)?.[i>>1]]+f(a,i+1):""

Attempt This Online!

Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES11), 67 bytes

Expects ([str1, str2]).

f=(a,i=j=0)=>(a+a)[j]?[a[i].match(/(.)\1*/g)?.[j]]+f(a,i^1,j+=i):""

Attempt This Online!