Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • \$\begingroup\$ If I loops all the way back around to i then s[I] will be a again, so while(I:=(I+1)%len(s))!=i and s[I]!=a: can just be while s[(I:=~-I%len(s))]!=a:. (I've included a golf of (I+1) -> ~-I in there.) - 152 \$\endgroup\$ Commented May 1 at 20:20
  • \$\begingroup\$ ...get rid of enumerate and use tuples to allow shoving initialisation of variables into f's parameters - 145. \$\endgroup\$ Commented May 1 at 20:24
  • \$\begingroup\$ return s>s[:len({*k})] (inverts results) saves two more. \$\endgroup\$ Commented May 1 at 20:55