嗨,我是 Fly,用 Ruby 寫 Chatbot 並挑戰30天分享心得
為確保不會沒靈感
每日含 Ruby 解題增加內容
https://www.hackerrank.com/domains/tutorials/30-days-of-code
轉一大圈,想太複雜!以零切開,最大值算一
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')