You are not logged in. Please login at www.codechef.com to post your questions!

×

RKABOL06 - Editorial

PROBLEM LINK:

Practice
Contest

Author: ravikiran0606
Editorialist: 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

ravikiran0606's gravatar image

4★ravikiran0606
41
accept rate: 0%

edited 15 Mar, 13:37

admin's gravatar image

0★admin ♦♦
19.5k348496535

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×15,030
×1,535
×19
×19
×19

question asked: 13 Mar, 14:55

question was seen: 117 times

last updated: 15 Mar, 13:37