Created
December 21, 2017 23:32
-
-
Save kasper573/803fe229681353fc01768f9df21a4d7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var S = readline(); | |
var max = ''; | |
var re = /(.)\1+/g; | |
while (res = re.exec(S)) { | |
if (res[0].length > max.length) { | |
max = res[0]; | |
} | |
} | |
if (!max) { | |
max = S[0]; | |
} | |
print(max[0] + ' ' + max.length); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment