Skip to main content
deleted 43 characters in body
Source Link
Riley
  • 11.7k
  • 2
  • 23
  • 53

Retina, 1111 7 bytes

-4 thanks to Martin Ender

.* $*1 ¶ $* 1 

Try it online!Try it online!

 

Lines 1-2: Convert to unary.
Lines 3-4: Remove newlines.
Line 5: count

.* $* 

Count the number of 1s (convert to decimal).:

1 

Retina, 11 bytes

.* $*1 ¶ 1 

Try it online!

Lines 1-2: Convert to unary.
Lines 3-4: Remove newlines.
Line 5: count the number of 1s (convert to decimal).

Retina, 11 7 bytes

-4 thanks to Martin Ender

.* $* 1 

Try it online!

 

Convert to unary:

.* $* 

Count the number of 1s:

1 
Source Link
Riley
  • 11.7k
  • 2
  • 23
  • 53

Retina, 11 bytes

.* $*1 ¶ 1 

Try it online!

Lines 1-2: Convert to unary.
Lines 3-4: Remove newlines.
Line 5: count the number of 1s (convert to decimal).