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 Revisions

3 of 3
added 492 characters in body
l4m2
  • 32.4k
  • 2
  • 26
  • 115

JavaScript (Node.js), 43 bytes

x=>~(g=s=>~s.indexOf(x,1)||g(s+i++))(x,i=1)

Try it online!

Using range, fail 11 (expect 13, get 1)

JavaScript (Node.js), 49 bytes

x=>~(g=s=>~s.search(x)||g(s+ ++i))(i='')+x.length

Try it online!

-4 from Arnauld

Not using the 10

l4m2
  • 32.4k
  • 2
  • 26
  • 115

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