Result

WA

Duration

1045ms

Code [DL]

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

stdin

755 793
873 839
929 443
977 778
175 259
719 119
428 648
313 321
517 791
693 932
255 114
155 557
651 547
875 833
922 567
688 872
523 927
335 551
522 528
495 596
898 594
834 937
339 395
158 857
186 898
455 336
741 117
599 892
436 752
655 513
597 662
298 997

stdout

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

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffea8fb79c0 /* 9 vars */) = 0
11    execve("/bin/cat", ["cat", "-"], 0x55cdef802d40 /* 9 vars */ <unfinished ...>
12    execve("/usr/local/ruby-2.7.1/bin/ruby", ["/usr/local/ruby-2.7.1/bin/ruby", "/volume/CODE"], 0x55cdef802d60 /* 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=5, si_stime=2} ---
10    +++ exited with 0 +++