Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 33 characters in body
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, 30 bytes

.(?<=(2円*(.))+)
$.($#1*$>:&*) 

Try it online! Link includes test cases. Explanation: Uses @Arnauld's(削除) @Arnauld's (削除ここまで) @LuisfelipeDejesusMunoz's observation that the partial score is the product of the letter's index and the number of runs so far.

.(?<=(2円*(.))+)

For each letter, count the number of runs so far.

$.($#1*$>:&*) 

Replace it with the product of that with the letter's 1-based index.

Retina, 30 bytes

.(?<=(2円*(.))+)
$.($#1*$>:&*) 

Try it online! Link includes test cases. Explanation: Uses @Arnauld's observation that the partial score is the product of the letter's index and the number of runs so far.

.(?<=(2円*(.))+)

For each letter, count the number of runs so far.

$.($#1*$>:&*) 

Replace it with the product of that with the letter's 1-based index.

Retina, 30 bytes

.(?<=(2円*(.))+)
$.($#1*$>:&*) 

Try it online! Link includes test cases. Explanation: Uses (削除) @Arnauld's (削除ここまで) @LuisfelipeDejesusMunoz's observation that the partial score is the product of the letter's index and the number of runs so far.

.(?<=(2円*(.))+)

For each letter, count the number of runs so far.

$.($#1*$>:&*) 

Replace it with the product of that with the letter's 1-based index.

Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Retina, 30 bytes

.(?<=(2円*(.))+)
$.($#1*$>:&*) 

Try it online! Link includes test cases. Explanation: Uses @Arnauld's observation that the partial score is the product of the letter's index and the number of runs so far.

.(?<=(2円*(.))+)

For each letter, count the number of runs so far.

$.($#1*$>:&*) 

Replace it with the product of that with the letter's 1-based index.

AltStyle によって変換されたページ (->オリジナル) /