PioneerWoman
BAN USER- 1of 1 vote
AnswersWrite a program to accept a nonempty string of alphanumeric characters. Define a “run” as a
- PioneerWoman in United States
consecutive sequence of a single character. For example, “aaaa” is a run of length 4. The program will
print the longest run in the given string. If there is no single longest run, then you may print any of
those runs whose length is at least as long as all other runs in the string.
Example input: a
Example output: a
Example input: aab
Example output: aa
Example input: abbbbbcc
Example output: bbbbb
Example input: aabbccdd
Example output: aa| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer - 1of 1 vote
AnswersWrite a program to accept a nonempty string of 0's and 1's as an argument. The program will print the
- PioneerWoman in United States
offsets of runs, each run consisting of all 0's or all 1's, where the runs are longer than 1. For example, if
given "0010011" it will print "0, 3, 5" on stdout.| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer