+ 15

[ASSIGNMENT] Nearest Palindrome

For a give number n,write a code to find the nearest or the next smallest palindrome larger than this number. E.g: If input is "1234" the output should be "1331" if input is "999" the output should be "1001"

26th Mar 2018, 1:54 PM
Mitali
Mitali - avatar
27 Answers
25th Aug 2018, 5:28 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 14
Burglarian Fox Here's, two codes. First : on beginners way. Second: translation of Kotlin's code https://code.sololearn.com/cyBKjMptrG35/?ref=app https://code.sololearn.com/c1xPL7L1XngY/?ref=app
1st Apr 2018, 11:56 AM
LukArToDo
LukArToDo - avatar
+ 13
Burglarian Fox You're welcome 😉
1st Apr 2018, 9:15 PM
LukArToDo
LukArToDo - avatar
1st Apr 2018, 7:20 AM
LukArToDo
LukArToDo - avatar
+ 11
mitali jadhavrao Thank you 😉
1st Apr 2018, 7:34 AM
LukArToDo
LukArToDo - avatar
+ 10
Here's my attempt on the challenge. Thanks for the idea : ) https://code.sololearn.com/cI5MLAQIPlm8/?ref=app
26th Mar 2018, 11:16 PM
Ipang
+ 9
https://code.sololearn.com/WU4crURsgvzT/?ref=app https://code.sololearn.com/cvGEFoFZsULN/?ref=app
27th Mar 2018, 9:50 AM
VISHAL SRIVASTAVA
VISHAL SRIVASTAVA - avatar
+ 9
mitali jadhavrao Do we need to find the nearest or next smallest palindrome number? Example : Input: 1234 Nearest : 1221 Next smallest : 1331
31st Mar 2018, 10:52 AM
LukArToDo
LukArToDo - avatar
26th Mar 2018, 2:04 PM
Vishal Pal❄️⚛️
Vishal Pal❄️⚛️ - avatar
+ 7
https://code.sololearn.com/cvu6lxCE8vAw/?ref=app
28th Mar 2018, 10:51 AM
Abhimanyu Gupta
Abhimanyu Gupta - avatar
+ 6
@Vishal Pal Thanks alot for the suggestion👍
26th Mar 2018, 2:06 PM
Mitali
Mitali - avatar
+ 6
I think I did it, it is mainly string manipulation: https://code.sololearn.com/chExBrG8Gpzo/?ref=app
26th Mar 2018, 5:58 PM
Paul
Paul - avatar
+ 6
@Ipang Yes I have submitted this challenge in lesson Factory.I hope they will make this an assignment. 😊
27th Mar 2018, 9:10 AM
Mitali
Mitali - avatar
+ 5
Great Thanks alot @paul and @Ipang for taking part🙂
27th Mar 2018, 5:29 AM
Mitali
Mitali - avatar
+ 5
@Mitali, Thanks, and you're welcome, so have you submitted this challenge in Lesson Factory yet (as @Vishal suggested), I guess it would be fun to see it in assignment list later : )
27th Mar 2018, 9:07 AM
Ipang
+ 4
Alright, I hope so too @Mitali, best of luck then... : )
27th Mar 2018, 9:14 AM
Ipang
+ 4
Abhimanyu Great code. Thanks for taking part👍
28th Mar 2018, 3:08 PM
Mitali
Mitali - avatar
+ 3
nice one
26th Mar 2018, 1:56 PM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
VISHAL SRIVASTAVA both the codes are equally good. Thanks for taking part.👍
28th Mar 2018, 3:08 PM
Mitali
Mitali - avatar
+ 3
LukArToDo You have coded for both the cases 👍 Good one.
1st Apr 2018, 7:31 AM
Mitali
Mitali - avatar