Skip to main content
added 86 characters in body
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

Ruby, 62 4646 28 bytes

->c,d{(c..d)[*c.to_a.map(&:to_s)d].join.count("1") ?1}

Try it online!-18 bytes, courtesy of Dingus.

Try it online!

Ruby, 62 46 bytes

->c,d{(c..d).to_a.map(&:to_s).join.count("1")}

Try it online!

Ruby, 62 46 28 bytes

->c,d{[*c..d].join.count ?1}

-18 bytes, courtesy of Dingus.

Try it online!

Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

Ruby, 62 46 bytes

->c,d{(c..d).to_a.map(&:to_s).join.count("1")}

Try it online!