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\$ 0000 is also congruent to 0 modulo 3 but again you can't have the first and last letters the same, so, like 15, you don't need to explicitly test for it. \$\endgroup\$ Commented Oct 17, 2016 at 18:40
  • \$\begingroup\$ For that initial version, can you use !((a>b)-(b>c)+(c>d)-(d>e))? \$\endgroup\$ Commented Oct 17, 2016 at 18:43
  • \$\begingroup\$ p<c?0:NaN can be written as 0/(p<c), which saves 2 bytes. \$\endgroup\$ Commented Oct 17, 2016 at 18:52
  • \$\begingroup\$ @Neil Regarding the test against 0: you're perfectly right. (However, I do need the k? test because of the possible NaN.) Regarding your alternate version: that should work indeed. \$\endgroup\$ Commented Oct 17, 2016 at 18:54
  • \$\begingroup\$ @IsmaelMiguel - Good call! Thanks. \$\endgroup\$ Commented Oct 17, 2016 at 19:01