🏁[Challenge: Binary Palindromes]🏁 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 20

🏁[Challenge: Binary Palindromes]🏁

Find all numbers till a given n whose binary string is a palindrome. Example: 3 --> 11 5 --> 101 ... Run the code for more examples, any language is welcome. Happy coding😊 https://code.sololearn.com/cw7fCNo6ARLE/?ref=app

12th Oct 2017, 6:32 AM
Jonas Schröter
Jonas Schröter - avatar
27 Answers
12th Oct 2017, 7:01 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
12th Oct 2017, 1:21 PM
m abrate
m abrate - avatar
12th Oct 2017, 5:21 PM
Vukan
Vukan - avatar
12th Oct 2017, 8:40 AM
noobcøder
noobcøder - avatar
13th Oct 2017, 2:08 AM
David Ashton
David Ashton - avatar
+ 10
https://code.sololearn.com/cWzApH7G2f5S/?ref=app Did a little extension
12th Oct 2017, 6:50 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 8
I am using the luxury of Python's inbuilt functions
12th Oct 2017, 6:56 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 8
Yay for once I did something ahead of you sir!
12th Oct 2017, 7:02 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
12th Oct 2017, 12:46 PM
LukArToDo
LukArToDo - avatar
12th Oct 2017, 10:52 AM
Alexey Zlo
Alexey Zlo - avatar
+ 7
https://code.sololearn.com/cbe7prt0qK3k/?ref=app
13th Oct 2017, 12:39 PM
Ekansh
+ 6
Number.prototype.pd = function() { return [...Array(+this).keys()].map(v=> v.toString(2)).filter(c=> c==c.split('').reverse().join('')); } https://code.sololearn.com/WBo2vfcCk1B1/?ref=app
12th Oct 2017, 10:23 AM
Calviղ
Calviղ - avatar
12th Oct 2017, 12:14 PM
sayan chandra
sayan chandra - avatar
12th Oct 2017, 12:21 PM
Stepan Bauer
+ 6
https://code.sololearn.com/cVTB196TCE8J/#cpp Cpp solution
12th Oct 2017, 1:48 PM
nevu
nevu - avatar
+ 6
just for fun first created pallindromes via recursion after filtered result not better but different :-) https://code.sololearn.com/ciTmjrYmn26f
12th Oct 2017, 6:27 PM
Oma Falk
Oma Falk - avatar
+ 6
Here you go. Checks for valid input https://code.sololearn.com/cdrxWnR6E0I4/?ref=app
13th Oct 2017, 12:32 AM
Vari93
Vari93 - avatar
+ 5
My solution with filter, lambda in python https://code.sololearn.com/cbkhSDFaof72
12th Oct 2017, 12:25 PM
Oma Falk
Oma Falk - avatar
+ 5
https://code.sololearn.com/c7OfyCMokz3a/?ref=app
13th Oct 2017, 6:32 AM
Marfik Em
Marfik Em - avatar
13th Oct 2017, 7:43 AM
Sudipta Kumar Nath
Sudipta Kumar Nath - avatar