Reflections on isPalindrome

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 27 14:28:14 PDT 2014


On Monday, 27 October 2014 at 16:59:19 UTC, Nordlöw wrote:
> On Monday, 27 October 2014 at 12:10:59 UTC, Marc Schütz wrote:
>> You could add an early `return false;` if the range has length 
>> and it is less than minLength.
>
> See update :)
>
> Thanks!

And you can return true if length <= 1

Why bidirectional range only?


More information about the Digitalmars-d-learn mailing list