+ 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
30 ответов
+ 18
+ 13
here's mine... 🐍
https://code.sololearn.com/cLz46lT4X05U/?ref=app
+ 13
my C# version...
https://code.sololearn.com/c084t8eKgvB3/?ref=app
+ 12
* My try in Ruby:
https://code.sololearn.com/c1mE3f8Saxsq/#rb
+ 11
+ 10
https://code.sololearn.com/cWzApH7G2f5S/?ref=app
Did a little extension
+ 8
I am using the luxury of Python's inbuilt functions
+ 8
Yay for once I did something ahead of you sir!
+ 7
Here is my Java realization
https://code.sololearn.com/cDdTCq0T9Y1P/?ref=app
+ 7
https://code.sololearn.com/cbe7prt0qK3k/?ref=app
+ 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
+ 6
heres mine...
one line
https://code.sololearn.com/cBJrn7mqIWvG/?ref=app
+ 6
My try on java
https://code.sololearn.com/chtNy9k07R3e/?ref=app
+ 6
https://code.sololearn.com/cVTB196TCE8J/#cpp
Cpp solution
+ 6
just for fun
first created pallindromes via recursion
after filtered result
not better but different :-)
https://code.sololearn.com/ciTmjrYmn26f
+ 6
Here you go. Checks for valid input
https://code.sololearn.com/cdrxWnR6E0I4/?ref=app
+ 5
My solution with filter, lambda in python
https://code.sololearn.com/cbkhSDFaof72
+ 5
https://code.sololearn.com/c7OfyCMokz3a/?ref=app
+ 5
https://code.sololearn.com/cMk2eExvRfCA/?ref=app
my code using cpp