+ 4
Challenge: palindrome string😈😓
Write a program to determine if a string is a palindrome. User will input the string in the Command line. palindrome : a word, phrase, or sequence that reads the same backwards as forwards. e.g- madam,nurses run,etc. Enjoy😃😉
10 Réponses
+ 13
https://code.sololearn.com/WYd5Bgyl31K4/?ref=app
https://code.sololearn.com/cVYt1TBBOX8u/?ref=app
+ 13
https://code.sololearn.com/cBB42CSLuFkC/?ref=app
+ 10
https://code.sololearn.com/cU4zbs3M09gn/?ref=app
+ 5
Pythonic solution:
x = input()
print("Palindrome!" if x == x[::-1] else "Not palindrome...")
+ 3
Java Code here:
Step1:
Input a string.
Step2:
Convert the String to a StringBuilder object because StringBuilder class has reverse function that can reverse a string.
Step3:
Convert the StringBuilder object back to String data type.
Step4.
Compare the inout String with the converted String.
https://code.sololearn.com/cHMKM8Eh1xXI/?ref=app
0
Optimized algorithm, support for UNICODE
https://code.sololearn.com/cm7eot7EClZ9/?ref=app
https://code.sololearn.com/c6kya4F7E31e/?ref=app
https://code.sololearn.com/cuYF9WIytw20/?ref=app