Result

AC

Duration

924ms

Code [DL]

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

stdin

698 934
832 328
511 217
935 937
366 661
316 667
876 934
655 584
493 593
366 655
886 813
577 668
291 227
417 115
713 889
179 156
533 544
515 235
658 886
977 676
257 787
799 884
584 485
638 212
566 898
847 748
898 988
174 343
977 771
397 991
662 822
965 514

stdout

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

stderr

strace

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