PROBLEM LINK:Author: ravikiran0606 DIFFICULTY:CAKEWALK PROBLEM:Given an array of N integers consisting only of numbers 0 or 1 and integer K, we need to find whether there are at least K consecutive ones in the array. EXPLANATION:In this question, we just need to iterate through the numbers in the array and store the count of consecutive ones upto the i'th position and check whether it is greater than or equal to K. If so mark the answer is "Yes" else "No". AUTHOR'S SOLUTION:Author's solution can be found here
This question is marked "community wiki".
asked 13 Mar, 14:55
