0

Judging the palindrome

How to judge a string is a palindrome?For example,if I input"aba", console will output"It is a palindrome!".If I input "add",console will output"It is not a palindrome!"

25th Dec 2018, 7:23 AM
105554723
105554723 - avatar
3 Réponses
+ 5
Hi! In order for us to help you, we need to see the effort on your part. Try to solve it on your own first. If you get stuck then post a link to your code here and we'll help debug it for you. :-)
25th Dec 2018, 7:34 AM
Lambda_Driver
Lambda_Driver - avatar
0
My approach would be split into 2 string in equal length, reverse 1 of them. Check if both string are same
25th Dec 2018, 7:34 AM
Taste
Taste - avatar
0
I've tried to use array.However,the length of array is setted before I use it,that means I need to know the length of the string which I will input.So how can I judge the plalindrom at the circumstance that the length of the string is unknow? https://code.sololearn.com/cuL4MHhOrrSB/?ref=app
25th Dec 2018, 10:13 AM
105554723
105554723 - avatar