We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
intgetWays(intn,int*squares,intd,intm){// Complete this functionintsum[105];intcount=0;sum[0]=0;for(inti=0;i<n;i++)sum[i+1]=sum[i]+squares[i];for(inti=0;i<=n-m;i++){if(sum[i+m]-sum[i]==d){count++;}}returncount;}
Subarray Division
You are viewing a single comment's thread. Return to all comments →