Created
March 17, 2022 22:26
-
-
Save see-why/5d077136b9939b6cc0d4d9042be66db4 to your computer and use it in GitHub Desktop.
HackerRank Beautiful Binary String challenge solution
This file contains 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
# https://www.hackerrank.com/challenges/countingsort2/problem?isFullScreen=true | |
def beautifulBinaryString(b): | |
# Write your code here | |
if '010' not in b: | |
return 0 | |
else: | |
return b.count('010') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment