30 Answers
New AnswerFind 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
10/12/2017 6:32:37 AM
Jonas Schröter30 Answers
New Answerhttps://code.sololearn.com/cWzApH7G2f5S/?ref=app Did a little extension
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
just for fun first created pallindromes via recursion after filtered result not better but different :-) https://code.sololearn.com/ciTmjrYmn26f
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message