Skip to main content
Commonmark migration
Source Link

#Dyalog APL, 19 17 16 bytes ≢+#⍎'\d'⎕R'&+',⊢

Dyalog APL, 19 17 16 bytes

≢+#⍎'\d'⎕R'&+',⊢

Takes string and returns

length
+ plus
# in root namespace
evaluation of
'\d'⎕R'&+' regex append digits with a plus
, followed by
the unmodified string

–3 thanks to ngn

#Dyalog APL, 19 17 16 bytes ≢+#⍎'\d'⎕R'&+',⊢

Takes string and returns

length
+ plus
# in root namespace
evaluation of
'\d'⎕R'&+' regex append digits with a plus
, followed by
the unmodified string

–3 thanks to ngn

Dyalog APL, 19 17 16 bytes

≢+#⍎'\d'⎕R'&+',⊢

Takes string and returns

length
+ plus
# in root namespace
evaluation of
'\d'⎕R'&+' regex append digits with a plus
, followed by
the unmodified string

–3 thanks to ngn

-1
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287

#Dyalog APL, 19 17 17 16 bytes ≢+(⍎'\d'⎕R'&+'≢+#⍎'\d'⎕R'&+',⊢)

Takes string and returns

length
+ plus
# in root namespace
the evaluation of
       '\d'⎕R'&+' regex append digits with a plus
     , followed by
        the unmodified string

–2–3 thanks to ngn

#Dyalog APL, 19 17 bytes ≢+(⍎'\d'⎕R'&+',⊢)

Takes string and returns

length
+ plus
the evaluation of
    '\d'⎕R'&+' regex append digits with a plus
   , followed by
     the unmodified string

–2 thanks to ngn

#Dyalog APL, 19 17 16 bytes ≢+#⍎'\d'⎕R'&+',⊢

Takes string and returns

length
+ plus
# in root namespace
evaluation of
   '\d'⎕R'&+' regex append digits with a plus
  , followed by
    the unmodified string

–3 thanks to ngn

-2
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287

#Dyalog APL, 1919 17 bytes ⍎+≢+#⍎¯1↓'\d'⎕R'&+'≢+(⍎'\d'⎕R'&+',⊢)

Takes string and returns

'\d'⎕R'&+' regex append digits with a pluslength
+ dropplus
¯1 one trailing character
evaluate in
# the root namespaceevaluation of
      +'\d'⎕R'&+' regex append digits with a plus
the length of the string
     +, plusfollowed by
        the evaluation of the entireunmodified string
 

–2 thanks to ngn

#Dyalog APL, 19 bytes ⍎+≢+#⍎¯1↓'\d'⎕R'&+'

Takes string and returns

'\d'⎕R'&+' regex append digits with a plus
drop
¯1 one trailing character
evaluate in
# the root namespace
 + plus
the length of the string
 + plus
   the evaluation of the entire string
 

#Dyalog APL, 19 17 bytes ≢+(⍎'\d'⎕R'&+',⊢)

Takes string and returns

length
+ plus
the evaluation of
     '\d'⎕R'&+' regex append digits with a plus
    , followed by
      the unmodified string

–2 thanks to ngn

Post Undeleted by Adám
now compliant with negative numbers
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287
Loading
Post Deleted by Adám
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287
Loading