You are viewing a single comment's thread. Return to all comments →
If we're golfing it, then:
$><<$_.to_i.to_s(2).split(?0).max.size
run with ruby -n. Using strip or chomp is unecessary if you're using to_i. The line noise at the beginning is:
ruby -n
strip
chomp
to_i
$> # synonym for STDOUT << # shovel operator (appends things) $_ # first line of input
Code golf is probably bad for the brain.
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
If we're golfing it, then:
run with
ruby -n
. Usingstrip
orchomp
is unecessary if you're usingto_i
. The line noise at the beginning is:Code golf is probably bad for the brain.