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*

7
  • \$\begingroup\$ Might help to use the register (£/¥) rather than named variables (←x) \$\endgroup\$ Commented Mar 29, 2023 at 16:52
  • \$\begingroup\$ Also, the range and duplicates are implicit: Try it online or verify more test cases \$\endgroup\$ Commented Mar 29, 2023 at 17:37
  • \$\begingroup\$ @TheThonnu How does Vyxal know that those operations are implicit? \$\endgroup\$ Commented Mar 29, 2023 at 17:49
  • \$\begingroup\$ When you loop over a number, it implicitly casts to a range. Also, when there is nothing left on the stack, the loop variable is used of you're in a loop, and the input is used otherwise. \$\endgroup\$ Commented Mar 29, 2023 at 17:57
  • 1
    \$\begingroup\$ Ok, enough golfing. \$\endgroup\$ Commented Mar 29, 2023 at 18:05