Day 10: Binary Numbers
轉一大圈,想太複雜!以零切開,最大值算一
轉一大圈,想太複雜!以零切開,最大值算一
scan
s = “this is a string with is thrice”
s.scan(/is/).count # => 3
p gets.to_i.to_s(2).split(‘0’).max.count(‘1’)
转载请注明:XAMPP中文组官网 » Day 10