{intcountOfZeros=0, count =0;fori=0; i < A.length; i++){if(A[i] ==0) countOfZeros++;(A[i] ==1) count += countOfZeros;if(count >1000000000)return-1; }returncount; } function{varzeroesCount=0;//keeps track of zeroesvarpairs=0;//aka the resultfor(vari=0; i<A.length; i...
While we rarely need to say long, specific numbers, we often have to use large, rounded figures in conversation. For instance, when asked how many people live in your country or how far it is from your hometown to the capital, you don’t want to spend 15 seconds counting zeros and bre...