cumulative max folding

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Given a string S, output a string T whose Kth character corresponds to the maximal character (by ASCII codepoint) seen in the first K characters in S. Or: Cumulatively fold maximum.

--conor_obrien

Options

exec is denied

rejudge feature is enabled

now post-mortem time, all source codes will be revealed

Sample input:_

what is the meaning of life?
hello
And What Would That Be, Good Sir?
...it's a word, of course!
Oh, you most preposterous man~

Sample output:

wwwwwwwwwwwwwwwwwwwwwwwwwwww
hhllo
Annnnnnttttuuuuuuuuuuuuuuuuuuuuuu
...ittttttwwwwwwwwwwwwwwww
Ohhhyyyyyyyyyyyyyyyyyyyyyyyyy~

Sample input:_

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#" !
!#$ "'%(&)-,+*.1/20347568=:9;<BA?@>FGDCEHJKLIMOQPNRVTUSWXY[Z`^]\_ecadbgfhjiknmolprqtsxyvuw{}~z|
Z?p%~1j,N xh9K<Wg(`i$y:lJ*GSV5P/"q8w;OtuFc#Dbz}CL+U0Q34X![r)R@Ik|>A-&T_.ds]voM=267^Y'{\EmenHBaf
&23",*#$)%(.+ /0'!-1;6=:GD75C<>FE8@A94B?NLJYIOMXRZH[TUPQVSKWieo_hjfdl]k\^g`ambcnwu|pvsy{qx}~rtz
]7h)#|t+*%{DT_f1`zon"<:SrC02(ybi?L34wF&9ZPjE-}s;Oc'VI>m@qG/Xvkx\eYApu Ugl,a.6=KQH![RB85^$NWMJ~d
&)-{:eOD8Mr_c^"|@9!x/lI0#hqoQ1~Bf3\VWH;j(vu4N.[LFCm+Yynta,A>*U=pG]Jb'E2$TZ5KSk`i7RPw}sg?z< %6dX
eDmvLW@oqGH\lhB9I$uk&i^]C:w6s)nj(<#zUNK MxJS,2/tb=;Xdc|>3R+QFZ7-%rY!gaT[~'f5A"0?yPpV`14.}O{*_8E
"! $#%(&'*+),-.0/13247569:8=;<@>?CABEDFGIHKJLONMQPRUTSVXW[YZ]^\_a`cbdefghjimklpnosrqutvxyw|z{}~
&,($.-'0 %2/!1*+"#)3=GA<@;F?6E95>:4C7D8BIWURJVHYXO[PQKZNLTSMdabmfogkl_i^j\enh]c`|y}rpqwvt{uszx~

Sample output:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!#$$$''(()----.1122347778=====BBBBBFGGGGHJKLLMOQQQRVVVVWXY[[`````eeeeegghjjknnooprrttxyyyy{}~~~
ZZpp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&2333333333333333333;;==GGGGGGGGGGGGGGGGNNNYYYYYYZZ[[[[[[[[[iiooooooooooooooooooww||||||||}~~~~
]]hhh||||||||||||||||||||||||||||||||||||||||}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}~~
&)-{{{{{{{{{{{{|||||||||||||||~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eemvvvvvvvvvvvvvvvvvvvvvvvwwwwwwwwwzzzzzzzzzzzzzzzzzzz||||||||||||||||||~~~~~~~~~~~~~~~~~~~~~~~
"""$$%(((*++,-.0013347779::===@@@CCCEEFGIIKKLOOOQQRUUUVXX[[[]^^_aaccdefghjjmmmpppsssuuvxyy|||}~
&,,,...0002222222223=GGGGGGGGGGGGGGGGGGGIWWWWWWYYY[[[[[[[[[[dddmmooooooooooooooo||}}}}}}}}}}}}~

Sample input:_

!! "ABACADABRA, ALA_KAZAM a bead of beds has found no zebras"
Nolan, do you believe in magic?
public static int main () {}
(INT []) void(3) { print(4) }
LF,1!:2(7)
                                                                          ~
aba bcb cdc ded efe
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Sample output:

!!!"ABBCCDDDRRRRRRR_______aabeeeeoooooossssssssuuuuuuuzzzzzzz
Noooooooooyyyyyyyyyyyyyyyyyyyyy
puuuuuuuuuuuuuuuuuuuuuuuuu{}
(INTT[]]]vvvvvvvv{{{{{{{{{{{}
LLLLLLLLLL
                                                                          ~
abbbbccccddddeeeeff
Lorrrrrrsuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1mitchs350.02712019/04/23 21:59:540B / 19B / 16B
2clock350.03242019/04/23 22:43:550B / 18B / 17B
3Histocrat350.04222019/04/27 03:06:160B / 20B / 15B
4rotary-o350.03342019/05/01 13:57:550B / 15B / 20B

Ruby2 _

RankUserSizeTimeDateStatistics
1mitchs350.15122019/04/23 22:58:120B / 15B / 20B
2rotary-o350.15852019/05/01 13:56:220B / 15B / 20B
3letranger370.15382019/04/24 01:23:080B / 13B / 21B
4Histocrat370.15252019/05/01 11:23:080B / 18B / 19B

Perl _

RankUserSizeTimeDateStatistics
1tails350.03492019/04/23 13:39:050B / 10B / 23B
2teebee350.03312019/05/02 16:37:540B / 11B / 23B
3nai360.03332019/04/26 15:19:040B / 14B / 20B

Python _

RankUserSizeTimeDateStatistics
1mitchs550.07932019/04/24 00:09:050B / 39B / 13B
2clock550.07692019/04/24 00:45:300B / 39B / 13B
3shinh550.07642019/04/24 20:14:320B / 39B / 13B
4beam2d550.07802019/04/24 22:31:380B / ?B / ?B
5hallvabo550.08132019/05/03 00:27:210B / 39B / 14B
6dianne560.08962019/05/06 17:46:360B / 39B / 14B
7Hendrik570.08182019/04/24 04:23:550B / 33B / 13B
8McBusLuck570.07382019/05/05 22:48:230B / ?B / ?B
9test630.07482019/04/23 22:00:400B / 36B / 16B

Python3 _

RankUserSizeTimeDateStatistics
1shinh540.11812019/04/24 20:20:510B / 30B / 14B
2clock540.12652019/04/24 20:38:340B / 30B / 14B
3mitchs540.12202019/04/24 21:07:130B / 30B / 14B
4beam2d540.12482019/04/24 21:35:560B / ?B / ?B
5Hendrik540.13902019/04/26 04:41:310B / 30B / 14B
6mypetlion540.22722019/04/30 02:19:530B / 30B / 14B

JavaScript _

RankUserSizeTimeDateStatistics
1clock610.11642019/04/24 22:25:390B / 37B / 21B
20mg610.04072019/04/27 10:07:120B / 37B / 21B

Lua _

RankUserSizeTimeDateStatistics
1clock660.03372019/04/27 23:58:431B / 41B / 17B
2tehtmi660.03312019/05/05 14:40:390B / 40B / 19B

REXX _

RankUserSizeTimeDateStatistics
1clock670.03992019/05/03 18:41:400B / 40B / 21B

J _

RankUserSizeTimeDateStatistics
1kritixilithos270.13392019/06/28 22:08:530B / 11B / 15B

C _

RankUserSizeTimeDateStatistics
1tails530.03222019/04/23 14:07:230B / 31B / 22B
2shinh530.03402019/04/24 18:23:380B / 31B / 22B
30mg530.03212019/04/27 12:01:540B / 31B / 22B
4nu530.03242019/05/07 11:27:320B / 31B / 22B
5beam2d540.03422019/04/28 23:33:000B / 31B / 23B
6chocobi560.03142019/04/23 23:32:500B / 32B / 24B
7McBusLuck560.03252019/05/06 04:46:150B / ?B / ?B

Haskell _

RankUserSizeTimeDateStatistics
1henkma390.04832019/04/27 11:18:400B / ?B / ?B
2HPWiz390.04082019/04/28 01:02:270B / 30B / 8B
3dianne390.03682019/05/02 11:44:350B / 30B / 8B
4Hendrik600.03852019/04/27 06:22:130B / 40B / 19B
5test660.03752019/04/27 01:02:480B / 48B / 16B

AWK _

RankUserSizeTimeDateStatistics
1mitchs430.03362019/05/05 13:11:270B / 19B / 24B
2clock470.03322019/05/02 00:49:400B / 21B / 26B
3teebee470.03272019/05/03 15:14:510B / 19B / 28B

Bash _

RankUserSizeTimeDateStatistics
1McBusLuck1070.04502019/05/06 05:11:390B / ?B / ?B

Bash (builtins) _

RankUserSizeTimeDateStatistics
1tails620.37572019/04/23 14:39:521B / 21B / 26B
2McBusLuck1070.04362019/05/06 03:27:580B / ?B / ?B

xgawk _

RankUserSizeTimeDateStatistics
1mitchs430.03292019/05/05 13:15:060B / 19B / 24B
2teebee470.04552019/05/03 15:29:470B / 19B / 28B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs520.05382019/04/25 02:01:280B / 0B / 52B

Hexagony _

RankUserSizeTimeDateStatistics
1hako310.46232019/04/26 01:00:540B / 2B / 29B

GolfScript _

RankUserSizeTimeDateStatistics
1tails130.08922019/04/24 12:21:070B / 3B / 10B
2mitchs130.08282019/04/24 17:45:250B / 3B / 10B
3clock130.08862019/05/02 04:15:040B / 3B / 10B
4mitchs (alt)140.61522019/04/25 12:44:410B / 3B / 11B

gs2 _

RankUserSizeTimeDateStatistics
1tails40.21322019/04/23 13:29:501B / 3B / 0B
2mitchs40.18952019/04/23 22:10:001B / 3B / 0B

Burlesque _

RankUserSizeTimeDateStatistics
1Hendrik180.07342019/05/05 23:51:540B / 11B / 7B
2clock190.04802019/05/06 01:26:530B / 6B / 13B

Scala _

RankUserSizeTimeDateStatistics
1rotary-o556.13162019/05/01 14:41:080B / 36B / 16B
2Hendrik576.29372019/04/24 04:35:440B / 37B / 15B

Logo _

RankUserSizeTimeDateStatistics
1clock770.05702019/04/30 00:14:400B / 41B / 24B

Language Ranking_

RankLangUserSizeScore
1gs2tails410000
2GolfScripttails133076
3BurlesqueHendrik182222
4Jkritixilithos271481
5Hexagonyhako311290
6Perltails351142
7Rubymitchs351142
8Ruby2mitchs351142
9Haskellhenkma391025
10AWKmitchs43930
11xgawkmitchs43930
12Brainfuckmitchs52769
13Ctails53754
14Python3shinh54740
15Pythonmitchs55727
16Scalarotary-o55727
17JavaScriptclock61655
18Bash (builtins)tails62645
19Luaclock66606
20REXXclock67597
21Logoclock77519
22BashMcBusLuck107373

return to the top page