Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 7 characters in body
Source Link
ngn
  • 15.6k
  • 2
  • 45
  • 90

JavaScript (Node.js), (削除) 80 73 (削除ここまで) 7368 bytes

f=([x,...y])=>x?f,g=c=>f(y).map(z=>x+zz=>c+z).concat(x=='v')=>x?fg(yx).mapconcat(z=>'^'+z)x>'a'?g`^`:[]):[y]

Try it online! Try it online!

JavaScript (Node.js), (削除) 80 (削除ここまで) 73 bytes

f=([x,...y])=>x?f(y).map(z=>x+z).concat(x=='v'?f(y).map(z=>'^'+z):[]):[y]

Try it online!

JavaScript (Node.js), (削除) 80 73 (削除ここまで) 68 bytes

f=([x,...y],g=c=>f(y).map(z=>c+z))=>x?g(x).concat(x>'a'?g`^`:[]):[y]

Try it online!

deleted 9 characters in body
Source Link
ngn
  • 15.6k
  • 2
  • 45
  • 90

JavaScript (Node.js), 80(削除) 80 (削除ここまで) 73 bytes

f=x=>x?(r=ff=(x[x,.slice(1)..y])=>x?f(y).map(y=>x[0]+yz=>x+z).concat(x[0]=='v'x=='v'?rf(y).map(y=>'^'+yz=>'^'+z):[]):[x][y]

Try it online! Try it online!

JavaScript (Node.js), 80 bytes

f=x=>x?(r=f(x.slice(1))).map(y=>x[0]+y).concat(x[0]=='v'?r.map(y=>'^'+y):[]):[x]

Try it online!

JavaScript (Node.js), (削除) 80 (削除ここまで) 73 bytes

f=([x,...y])=>x?f(y).map(z=>x+z).concat(x=='v'?f(y).map(z=>'^'+z):[]):[y]

Try it online!

Source Link
ngn
  • 15.6k
  • 2
  • 45
  • 90

JavaScript (Node.js), 80 bytes

f=x=>x?(r=f(x.slice(1))).map(y=>x[0]+y).concat(x[0]=='v'?r.map(y=>'^'+y):[]):[x]

Try it online!

AltStyle によって変換されたページ (->オリジナル) /