Result

WA

Duration

1126ms

Code [DL]

(x=$_[/(.)\1* /]
y=$_[/ (.)\1*/]
puts x.size>y.size ? x[0] : y[-1])while gets

stdin

386 465
936 385
811 665
495 485
896 669
938 835
866 662
343 492
677 776
636 518
972 772
766 488
734 454
933 848
297 996
677 781
321 992
282 829
646 892
325 655
979 917
293 934
299 663
433 318
633 138
419 993
367 556
157 452
335 175
264 563
381 181
566 468

stdout

4
3
6
4
6
8
6
4
7
5
7
6
4
3
9
7
9
8
8
6
9
9
6
3
3
9
5
4
1
5
1
6

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffcfc377f50 /* 9 vars */) = 0
11    execve("/bin/cat", ["cat", "-"], 0x564101c4dd40 /* 9 vars */ <unfinished ...>
12    execve("/usr/local/ruby-2.7.1/bin/ruby", ["/usr/local/ruby-2.7.1/bin/ruby", "/volume/CODE"], 0x564101c4dd60 /* 9 vars */ <unfinished ...>
11    <... execve resumed>)             = 0
12    <... execve resumed>)             = 0
11    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
12    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12, si_uid=0, si_status=0, si_utime=6, si_stime=4} ---
10    +++ exited with 0 +++