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\$ I don't think code golf rules allow you to pass extra data to functions, but you can work around that by providing a default argument for c. \$\endgroup\$ Commented Mar 23 at 10:15
  • \$\begingroup\$ 98 bytes using a while loop to replace the for (with the on-break stuff occurring unconditionally after loop), plus tweaking i+=[i.pop(x)] to i+=i.pop(x), (one-tuples costing one fewer characters). \$\endgroup\$ Commented Mar 24 at 19:40
  • \$\begingroup\$ @ShadowRanger 89 \$\endgroup\$ Commented Mar 24 at 20:50