@@ -0,0 +1,403 @@
+package hackerRank.HourRank8;%0A%0Aimport java.util.Scanner;%0A%0Apublic class _01BeautifulBinaryString %7B%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner scanner = new Scanner(System.in);%0A%09%09int n=scanner.nextInt();%0A%09%09String str=scanner.next();%0A%09%09int index=0;%0A%09%09int count=0;%0A%09%09while(str.indexOf(%22010%22, index)!=-1)%0A%09%09%7B%0A%09%09%09count+=1;%0A%09%09%09index=str.indexOf(%22010%22, index)+3;%0A%09%09%7D%0A%09%09System.out.println(count);%0A%09%7D%0A%7D%0A%0A

Hackerrank->Hourrank 8->beautifulbinary string