|
|
5 éve | |
|---|---|---|
| .. | ||
| README.md | 5 éve | |
| code.cpp | 5 éve | |
| unitTest.cpp | 5 éve | |
by Helen Yu tags: strings, loops, language_fundamentals
Write a function that returns the longest sequence of consecutive zeroes in a binary string. Examples longestZero("01100001011000") ➞ "0000" longestZero("100100100") ➞ "00" longestZero("11111") ➞ "" Notes If no zeroes exist in the input, return an empty string.
Write a function that returns the longest sequence of consecutive zeroes in a binary string.
longestZero("01100001011000") ➞ "0000"
longestZero("100100100") ➞ "00"
longestZero("11111") ➞ ""
If no zeroes exist in the input, return an empty string.