+ 1
🔡 CHALLENGE 🔢 CONSIDERED PALINDROME!
Note:A string is considered palindrome if it stays the same when you reverse it. User is to give a string of 2+ characters to the program, and it should swap 2 characters at different positions to make the string palindrome (it must do this step ONLY once). Print "Yes" if it is possible to make string palindrome, otherwise print "No"! For example: 1) input: ahah output: yes 2) input: alanl output: no Enjoy and Happy coding!
7 Answers
+ 10
Nice challenge 👍
I'm late, but here's :
https://code.sololearn.com/cH4YmqHaxFZV/?ref=app
+ 2
what do you mean by 'it must do this step only once'?
do you mean only 2 characters will be selected and swap in different positions?😦
+ 1
heres mine
only one time swap to make palindrome
prints swapping indices too
https://code.sololearn.com/c890nt0UY3wL/?ref=app
+ 1
Jonathan, yes, you can swap 2 characters between each other, like
a,b = b,a
but only one time
- 1
a new challenge...
get refreshed
https://www.sololearn.com/discuss/817002/?ref=app