Skip to main content
deleted 7 characters in body
Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240

Vyxal, 65 bytes

ĠvLʁf+Ġvẏf+

Try it Online!Try it Online!

-1 thanks to lyxal

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁfvẏf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answer.

Vyxal, 6 bytes

ĠvLʁf+

Try it Online!

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answer.

Vyxal, 5 bytes

Ġvẏf+

Try it Online!

-1 thanks to lyxal

Ġ     # Group runs of identical chars
 vẏf  # 0...n each and flatten
    + # Add to input

Port of caird coinheringaahing's answer.

Link to caird's answer
Source Link

Vyxal, 6 bytes

ĠvLʁf+

Try it Online!

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answercaird coinheringaahing's answer.

Vyxal, 6 bytes

ĠvLʁf+

Try it Online!

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answer

Vyxal, 6 bytes

ĠvLʁf+

Try it Online!

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answer.

deleted 49 characters in body
Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240

Vyxal, 76 bytes

KƛṫOnt+ĠvLʁf+

Try it Online!Try it Online!

K Ġ      # Prefixes
 ƛ   Group runs of #identical Map...chars
   OvL    # Count occurencesLength of..
  ṫ     # Last itemeach
   O  ʁf  # In0...
  ṫ     # Alln buteach lastand itemflatten
    nt+ + # AddedAdd to numberinput

Port of caird coinheringaahing's answer

Vyxal, 7 bytes

KƛṫOnt+

Try it Online!

K       # Prefixes
 ƛ      # Map...
   O    # Count occurences of..
  ṫ     # Last item
   O    # In...
  ṫ     # All but last item
    nt+ # Added to number

Vyxal, 6 bytes

ĠvLʁf+

Try it Online!

Ġ      # Group runs of identical chars
 vL    # Length of each
   ʁf  # 0...n each and flatten
     + # Add to input

Port of caird coinheringaahing's answer

Source Link
emanresu A
  • 44.4k
  • 5
  • 101
  • 240
Loading