New answers tagged

2 votes

What's the character limit of this text field?

Python 3, 55 bytes lambda s:"".join(map(str,range(1,1001))).find(s)+len(s) This is a rather simple solution, but it works.
Jakav's user avatar
  • 151
1 vote

What's the character limit of this text field?

Japt, 9 bytes +A³õ ¬ aN Try it
Shaggy's user avatar
  • 41.6k
3 votes

What's the character limit of this text field?

Charcoal, 10 bytes I⁺Lθ⌕⭆φ⊕ιθ Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 166k
2 votes

What's the character limit of this text field?

APL (Dyalog Classic), 22 bytes ≢-1-(⊃∘⍸⍷∘(⊃,/⍕¨⍳1E3)) Try it online! ...
Tbw's user avatar
  • 261
2 votes

What's the character limit of this text field?

Pip, 10 bytes Semi-port of lyxal's Vyxal answer J1,a~:Xa$) Attempt This Online! ...
math scat's user avatar
  • 8,563
3 votes

What's the character limit of this text field?

APL+WIN, 35 33 bytes Two bytes saved thanks to Tbw Prompts for string of digits: ↑(¯1+⍴s)+((s←,⎕)⍷n)/⍳⍴n←⊃,/⍕¨⍳1E3 Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 5,526
4 votes

What's the character limit of this text field?

Haskell, 65 63 bytes -2 bytes thanks to @AZTECCO n%h|l<-length n,n==take l h=l n%(_:h)=1+n%h f=(%([1..]>>=show)) Try it online!
matteo_c's user avatar
  • 5,863
4 votes

What's the character limit of this text field?

Perl 5 (-p), 27 bytes (join"",1..1e3)=~$_;$_="@+" Try it online!
Nahuel Fouilleul's user avatar
6 votes

What's the character limit of this text field?

Excel (ms365) 1) Recursion with LAMBDA(), 74 bytes: Formula in B1: ...
JvdV's user avatar
  • 3,403
3 votes

What's the character limit of this text field?

Retina 0.8.2, 38 bytes ^ 1001$*1¶ \G1 $.` r`\B\1.*¶(.*) $1 \B Try it online! Link includes test cases. Explanation: ...
Neil's user avatar
  • 166k
5 votes

What's the character limit of this text field?

Ruby, 34 30 bytes ->i{[*1..1e3]*''=~/(?<=#{i})/} Try it online! Thanks to @Neil for saving 1 Byte by removing useless + in regexp Regexp /(?<=#{i})+/ ...
AZTECCO's user avatar
  • 10.7k
5 votes

What's the character limit of this text field?

05AB1E, 7 bytes LJIkIg+ Times out for larger inputs. Add a leading (push 1000) to speed it up. Try it online or verify all ...
Kevin Cruijssen's user avatar
5 votes

What's the character limit of this text field?

JavaScript (Node.js), 43 bytes x=>~(g=s=>~s.indexOf(x,1)||g(s+i++))(x,i=1) Try it online! Using range, fail 11 (expect ...
l4m2's user avatar
  • 20.7k
5 votes

What's the character limit of this text field?

Vyxal, 50 bitsv2, 6.25 bytes ⌊ɾṅḟ?L+ Try it Online! Bitstring: 11001011010011010000000111000101111000110100000010 Times out ...
lyxal's user avatar
  • 32.3k
3 votes

Parse nested absolute values

05AB1E, 13 bytes ε'|Qižu®dèëy© Port of @Neil's Charcoal answer, so make sure to upvote that answer as well! Outputs as a list of characters. Try it online or ...
Kevin Cruijssen's user avatar
3 votes

Parse nested absolute values

JavaScript (Node.js), 44 bytes s=>s.replace(d=/./g,c=>c>{}?++d?')':'(':d=c) Try it online! Look last non-pipe character before each pipe. Converting pipe ...
tsh's user avatar
  • 34k
3 votes

Parse nested absolute values

Charcoal, 16 bytes FS≡ι|§)(‹ψ0«ι≔ιψ Try it online! Link is to verbose version of code. Explanation: FS≡ι Loop over the input ...
Neil's user avatar
  • 166k
5 votes

Parse nested absolute values

K (ngn/k), 27 22 bytes Based on Arnauld's answer, but without regex. {`c$(84-0=\"0|"'x)!'x} Try it online! Any closing parenthesis in the output directly ...
ovs's user avatar
  • 58.4k
1 vote

Parse nested absolute values 2

JavaScript (ES6), 52 bytes I believe my answer to the other version also works for this one... ¯\_(ツ)_/¯ ...
7 votes

Parse nested absolute values

Retina 0.8.2, 22 16 bytes T`|`)`\d\|+ \| ( Try it online! Link includes test cases. Explanation: T`|`)`\d\|+ Replace all ...
Neil's user avatar
  • 166k
9 votes

Parse nested absolute values

JavaScript (ES6), 52 bytes f=s=>s>(s=s.replace(/\|(.*?[\d)])\|/,"($1)"))?f(s):s Try it online! Method At each iteration, we look for the first ...
Arnauld's user avatar
  • 189k
2 votes

Ungolf the Wind

Perl 5 -n, 59 bytes / (...)(..)G?(..)?KT/;say for$1eq VRB?-1:$1*1,$2*1,$3*1||-1 Try it online!
Xcali's user avatar
  • 13.4k
3 votes

Ungolf the Wind

05AB1E, 13 bytes #3è3ô3£εþ®s‚à Try it online or verify all test cases. Explanation: ...
Kevin Cruijssen's user avatar
1 vote

Ungolf the Wind

sclin, 33 bytes w<>3:3/`3tk"\D"""\ /#1_.||# map N Try it on scline! Explanation Prettified code: ...
Mama Fun Roll's user avatar
2 votes

Ungolf the Wind

Python3, 104 bytes lambda s:((-1 if'VRB'in(s:=s.split()[3])else s[:3]),s[3:5],s[(i:=s.index('G'))+1:i+3]if'G'in s else -1) Try it online! Another approach (much ...
Amir reza Riahi's user avatar
3 votes

Ungolf the Wind

sed -E, 81 75 bytes -6 bytes thanks to @Jordan s/.{19}(...)(..)(G(..))?.*/ \1 \2 \4/;s/ VRB| $/ -1/g;s/ 0*(\w)/ \1/g;s/ // Attempt This Online!
matteo_c's user avatar
  • 5,863
4 votes

Ungolf the Wind

JavaScript, 54 45 bytes s=>[19,22,25].map(x=>~(-1-s.substr(x,x/7^1))) Try it online! −9 by using indices directly in the input string and the (deprecated) <...
m90's user avatar
  • 9,881
5 votes

Ungolf the Wind

Charcoal, 17 16 15 bytes …IE⪪ε³⁻Σ⁺ψι›ια³ Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 166k
5 votes

Ungolf the Wind

Jelly, 18 15 bytes Ḳ4ịs3ḣ3f€ØDȯ€-V Try it online! A monadic link taking a METAR-formatted string and returning a list of integers. (Has the side effect of ...
Nick Kennedy's user avatar
  • 19.2k
4 votes

Ungolf the Wind

Retina 0.8.2, 39 bytes 4=M!`\w+ 3M!`.{1,3} %(`\D ^0+\B ^$ -1 Try it online! Outputs the values on separate lines but link is to test suite that joins on commas ...
Neil's user avatar
  • 166k
2 votes

Ungolf the Wind

Uiua 0.4.1, 80 bytes ⊐∵parse≡(⊂⊂∩□⊃((∘|"¯1")≍"VRB"⊔.↙3|⊃↙(□↘+1)⊗@G.(⊂:"G¯1"|∘)∊@G.↙-2⧻.↘3)⊔⊡3⊜□≠@ .⊔) See it in action
RomanPro100's user avatar
5 votes

Ungolf the Wind

Google Sheets, 80 bytes ={iferror(--mid(A1,20,3),-1),mid(A1,23,2),ifna(--regexextract(A1,"G(\d\d)"),-1)} Put the input in cell ...
doubleunary's user avatar

Top 50 recent answers are included