OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project

Home Page:http://internship.opengenus.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Policeman catches thieves

Op-panda opened this issue · comments

This is a(n):

  • New algorithm
  • Update to an existing algorithm
  • Error
  • Proposal to the Repository

Details:

Greedy Algorithm application:
Given an array of size n that has the following specifications:

Each element in the array contains either a policeman or a thief.
Each policeman can catch only one thief.
A policeman cannot catch a thief who is more than K units away from the policeman.

We need to find the maximum number of thieves that can be caught.

@AdiChat please assign me this issue. I am a participant of Hacktoberfest