+ 4
CHALLENGE find number palindrome
This task was a qualifier task for the programmer olympics You need to find a palindrome greater than the number entered. A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, such as "madam" or "taco cat" or "race car". The palindrome must 1)be minimally bigger than the input number 2)input should to support the 10^6 digits and less example: input: output: 123456 -> 124421 1234567 -> 1235321 999 -> 1001 my solution on java https://code.sololearn.com/ch5iVEdPYRDx/#java
19 odpowiedzi
+ 16
https://code.sololearn.com/cbi2mCON48po/?ref=app
https://code.sololearn.com/cBPp3tx7qR4X/?ref=app
https://code.sololearn.com/cksrmcNjffVQ/?ref=app
+ 10
This is my try in C#-
(also my first ever code in C#)
Thanx for the challenge it was really interesting!! :)
https://code.sololearn.com/c06n4jaKh5DX/?ref=app
I've also done it in python.. Which is easy.
https://code.sololearn.com/ci4xGTWH8aC5/?ref=app
+ 9
@rusich You want 969969 to also search for the next palindrome instead of returning itself? Just fixed it if that's the case.
+ 9
Thanks for feedback. :>
+ 6
@rusich Done! Edited both the codes.
+ 6
Btw where is programming Olympics conducted!? I want that in my country 😭
+ 5
@rusich.. No; it does work for 777 and 999 I gave 776 and 998 as inputs.. And the output was 777 and 999 respectively. What did you give as the input?
+ 5
Updated original post with two more submissions.
+ 3
My brute force try in js:
https://code.sololearn.com/WwmxWE3Mzg3g/?ref=app
+ 2
@yash No, i mean if you enter number 777 in input it's does not work, in output we must get number 787 or for 999 output is 1001
+ 1
Hatsy Rei, your code not working with palindromes :969969, 999, and other, but code is cool, so short
+ 1
@Hatsy yep, now worked, great!
+ 1
@yash good job) i see cs synt looks like java. but your code also cant write palindrom for equal number 777, 999 can you fix it?)
+ 1
@yash thats was online olympic, you can see full info just write in search " it planet"
+ 1
i like oneline olympics. Oneliner solution here works for 1990 9999 190 or any number
https://code.sololearn.com/c280w5mcd4vs/?ref=app
+ 1
@Hatsy tnx very much for your work, i will analyze the algorithm and refact my code:)
+ 1
@Swapnil More tnx for answer)
0
@VcC You must find the closest palindrome greater than a provided number. Polinum for number 999 not 999 and etc.
program output:
999 => 999
969 => 969
9799979 => 9799979
959959 => 959959