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*

4
  • 1
    \$\begingroup\$ You can save some space by not wrapping in a function/method. However your code currently returns 0-based index (needs to be 1-based) and it also needs to return -1 if no palindrome found. \$\endgroup\$ Commented Apr 4, 2014 at 16:06
  • \$\begingroup\$ Fixed the -1, thanks. Not sure what you have in mind regards taking it out a method though, I'll have a think. \$\endgroup\$ Commented Apr 4, 2014 at 17:31
  • \$\begingroup\$ Ok, took your advise on board and rewrote it :), ty. \$\endgroup\$ Commented Apr 4, 2014 at 17:40
  • \$\begingroup\$ You're welcome! Now that is much better :) +1 \$\endgroup\$ Commented Apr 4, 2014 at 18:45