Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Palindrome-detection/Racket/palindrome-detection.rkt
Normal file
14
Task/Palindrome-detection/Racket/palindrome-detection.rkt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(define (palindromb str)
|
||||
(let* ([lst (string->list (string-downcase str))]
|
||||
[slst (remove* '(#\space) lst)])
|
||||
(string=? (list->string (reverse slst)) (list->string slst))))
|
||||
|
||||
;;example output
|
||||
|
||||
> (palindromb "able was i ere i saw elba")
|
||||
#t
|
||||
> (palindromb "waht the hey")
|
||||
#f
|
||||
> (palindromb "In girum imus nocte et consumimur igni")
|
||||
#t
|
||||
>
|
||||
Loading…
Add table
Add a link
Reference in a new issue