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*

5
  • \$\begingroup\$ Is returning a built-in Infinity value legal? \$\endgroup\$ Commented Mar 2, 2016 at 9:25
  • 1
    \$\begingroup\$ @Neil I will allow it, as I didn't even think of it, good point there. \$\endgroup\$ Commented Mar 2, 2016 at 10:56
  • 1
    \$\begingroup\$ Some of your example inputs start with a leading zero; is it intended that we can write our function with input "a positive integer" only if our language of choice won't automatically drop the leading zero? Many languages will be forced to take string input for this reason. \$\endgroup\$ Commented Mar 2, 2016 at 11:36
  • 1
    \$\begingroup\$ @ASimmons That's why I modified (a while back) the input so it can be a "string only composed of digits" aswell. Also, the important point isn't that it is a 0 but a holy digit, I will modify the post according to allow answer based on non-leading 0 numbers. \$\endgroup\$ Commented Mar 2, 2016 at 12:26
  • \$\begingroup\$ @katenkyo Yeah I saw you could input as a string but it seemed hard to take it as an integer. I approve of your edit to the OP. \$\endgroup\$ Commented Mar 2, 2016 at 13:56