How to determine is the string palindrome or not? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How to determine is the string palindrome or not?

Describe the best algorithm you think (programming language no important, use words to describe algorithm steps).

16th Sep 2017, 9:19 PM
ŠœŠ°Ń€Š³Š°Ń€ŠøтŠ° ŠœŠ¾Ń€Š¾Š·Š¾Š²Š°
ŠœŠ°Ń€Š³Š°Ń€ŠøтŠ° ŠœŠ¾Ń€Š¾Š·Š¾Š²Š° - avatar
4 Respostas
+ 1
some languages have a built in function to reverse a string but assuming you dont you could split the string up into single characters and use a for loop to go through them from last to worst to reconstruct the string backwards then check if its the same as the original string.
16th Sep 2017, 10:40 PM
Enzo
Enzo - avatar
27th Sep 2017, 3:48 PM
ŠœŠ°Ń€Š³Š°Ń€ŠøтŠ° ŠœŠ¾Ń€Š¾Š·Š¾Š²Š°
ŠœŠ°Ń€Š³Š°Ń€ŠøтŠ° ŠœŠ¾Ń€Š¾Š·Š¾Š²Š° - avatar
8th Dec 2017, 11:31 PM
Jonathan Ɓlex
Jonathan Ɓlex - avatar
9th Dec 2017, 11:33 AM
Jonathan Ɓlex
Jonathan Ɓlex - avatar