16 lines
228 B
Text
16 lines
228 B
Text
|
|
fn isPalindrome_r s =
|
||
|
|
(
|
||
|
|
if s.count <= 1 then
|
||
|
|
(
|
||
|
|
true
|
||
|
|
)
|
||
|
|
else
|
||
|
|
(
|
||
|
|
if s[1] != s[s.count] then
|
||
|
|
(
|
||
|
|
return false
|
||
|
|
)
|
||
|
|
isPalindrome_r (substring s 2 (s.count-2))
|
||
|
|
)
|
||
|
|
)
|