Quantcast
Viewing latest article 12
Browse Latest Browse All 23

Answer by Sp3000 for All about basic binary

Python 2, 90 * 0.75 = 67.5

n=input();b=1while b<n: b+=1;s="";c=k=n while k:s=`k%b`+s;c*=k%b<2;k/=b if c:print b,s

Pretty straightforward iterative approach.

Without the bonus, this is 73 bytes:

n=input();b=1while b<n: b+=1;c=k=n while k:c*=k%b<2;k/=b if c:print b

Viewing latest article 12
Browse Latest Browse All 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>